<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
    String queryString = request.getQueryString() == null ? "" : request.getQueryString().replaceAll("(\\&?lang\\=[a-zA-Z]{2}\\_[a-zA-Z]{2})|(lang\\=[a-zA-Z]{2}\\_[a-zA-Z]{2}\\&?)", "");
    String lang = request.getParameter("lang");
    String hspId =  request.getParameter("hospitalId");
    if (lang != null) {
        session.setAttribute("locale", lang);
    } else if (session.getAttribute("locale") == null) {
        session.setAttribute("locale", request.getLocale().toString());
    }
%>
<!DOCTYPE html>
<html lang="zh">
<c:if test="${'zh_CN'.equals(sessionScope.locale)}">
    <fmt:setLocale value="zh_CN"/>
</c:if>
<c:if test="${sessionScope.locale.indexOf('en') != -1}">
    <fmt:setLocale value="en_US"/>
</c:if>
<fmt:setBundle basename="charts" var="charts"/>
<fmt:bundle basename="charts">
    <head>
        <meta charset="utf-8"/>
            <%-- rem.js --%>
        <script src="<%=basePath%>/js/rem.js"></script>
        <title>医疗设备系统</title>
        <link rel="shortcut icon" href="<%=basePath%>/images/favicon.ico">
        <link href="<%=basePath%>/plugins/charts/css/global.css" rel="stylesheet"/>
        <link rel="stylesheet" href="<%=basePath%>/css/font-awesome.min.css">
        <link rel="stylesheet" href="<%=basePath%>/plugins/iziModal/css/iziModal.min.css">
        <link rel="stylesheet" href="<%=basePath%>/plugins/select2/select2.min.css">
        <link href="<%=basePath%>/plugins/charts/css/style.css" rel="stylesheet"/>
        <link href="<%=basePath%>/plugins/charts/css/select2-my.css" rel="stylesheet"/>
        <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
        <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/flavr.css">
    </head>
    <body>
    <div id="container">
            <%--顶部选项--%>
        <div class="head-container">
            <div class="head">
                <div class="fl global_area">
                    <i class="fa fa-arrow-left fl" onclick="javascript:history.go(-1);"></i>
                    <div class="fl" id="language">
                        <div class="language">
                            <c:choose>
                                <c:when test="${'zh_CN'.equals(sessionScope.locale)}">简体中文</c:when>
                                <c:when test="${sessionScope.locale.indexOf('en') != -1}">English</c:when>
                                <c:otherwise>简体中文</c:otherwise>
                            </c:choose>
                        </div>
                        <ul class="hide">
                            <li><a href="?<%=queryString%>&lang=zh_CN">简体中文</a></li>
                            <li><a href="?<%=queryString%>&lang=en_US">English</a></li>
                        </ul>
                    </div>
                    <ul class="global">
                        <li><a id="btn1"><fmt:message key="share.title.zl"/></a></li>
                        <li><a id="btn2" class="on"><span class="page" page-hospital="department-index"><fmt:message
                                key="share.title.fx"/></span>-<span class="page"
                                                                    page-hospital="model-index"><fmt:message
                                key="share.title.sbxh"/></span>-<fmt:message key="share.title.wxqk"/></a>
                        </li>
                        <li><a id="btn5"><img src="<%=basePath%>/plugins/charts/images/search.png"></a></li>
                        <li>
                            <a id="btn6" onclick="reset()">
                                <img src="<%=basePath%>/plugins/charts/images/reset.png">
                            </a>
                        </li>
                        <li><a id="btn7" onclick="logout()" title="<fmt:message key="share.title.tcdl"/>"><img src="<%=basePath%>/plugins/charts/images/logout.png"></a></li>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
        </div>
            <%--筛选条件--%>
        <jsp:include page="choose.jsp"></jsp:include>

        <div class="content" style="display:flex;flex-direction:column;justify-content:flex-start;">
                <%-- 总量统计 --%>
            <div class="totle">
                    <%-- 维修情况 --%>
                <div class="frame frame1" style="width:24%;">
                    <div class="border">
                        <div class="detail fl">
                            <p class="title"><em class="spanTitle active" id="title1"><fmt:message
                                    key="maintain.overview.wxqk"/></em><span
                                    id="yoy0" style="font-size:12px;color:#e68b36;text-decoration:none;"></span></p>
                            <p class="sum"><fmt:message key="maintain.overview.wsx"/>：<em id="count1-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.blsj"/>：<em id="yoy1-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                        </div>
                        <div class="chart fr chart-text">
                            <p class="sum"><fmt:message key="share.overview.kssl"/>：<em id="count1-2"></em> <fmt:message
                                    key="share.unit.ge"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxsbs"/><em id="yoy1-2"></em>
                                <fmt:message key="share.unit.tai"/></p>
                            <p class="line"></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxfy"/>：<em id="count1-3"></em>
                                <fmt:message key="share.unit.wanyuan"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.pjwxsj"/>：<em id="count1-4"></em>
                                <span><fmt:message key="share.unit.fenzhong"/></span></p>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                    <%-- 大维修 --%>
                <div class="frame" style="width:23%;">
                    <div class="border">
                        <div class="detail fl">
                            <p class="title">
                                <em class="spanTitle" id="title2"><fmt:message key="maintain.overview.dwx"/></em>
                            </p>
                            <p class="sum"><fmt:message key="maintain.overview.wsx"/>：<em id="count2-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.blsj"/>：<em id="yoy2-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                        </div>
                        <div class="chart fr chart-text">
                            <p class="sum"><fmt:message key="share.overview.kssl"/>：<em id="count2-2"></em> <fmt:message
                                    key="share.unit.ge"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxsbs"/><em id="yoy2-2"></em>
                                <fmt:message key="share.unit.tai"/></p>
                            <p class="line"></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxfy"/>：<em id="count2-3"></em>
                                <fmt:message key="share.unit.wanyuan"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.pjwxsj"/>：<em id="count2-4"></em>
                                <span><fmt:message key="share.unit.fenzhong"/></span></p>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                    <%-- 中维修 --%>
                <div class="frame" style="width:23%;">
                    <div class="border">
                        <div class="detail fl">
                            <p class="title"><em class="spanTitle" id="title3"><fmt:message
                                    key="maintain.overview.zwx"/></em></p>
                            <p class="sum"><fmt:message key="maintain.overview.wsx"/>：<em id="count3-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.blsj"/>：<em id="yoy3-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                        </div>
                        <div class="chart fr chart-text">
                            <p class="sum"><fmt:message key="share.overview.kssl"/>：<em id="count3-2"></em> <fmt:message
                                    key="share.unit.ge"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxsbs"/><em id="yoy3-2"></em>
                                <fmt:message key="share.unit.tai"/></p>
                            <p class="line"></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxfy"/>：<em id="count3-3"></em>
                                <fmt:message key="share.unit.wanyuan"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.pjwxsj"/>：<em id="count3-4"></em>
                                <span><fmt:message key="share.unit.fenzhong"/></span></p>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                    <%-- 小维修 --%>
                <div class="frame" style="width:23%;">
                    <div class="border">
                        <div class="detail fl">
                            <p class="title"><em class="spanTitle" id="title4"><fmt:message
                                    key="maintain.overview.xwx"/></em></p>
                            <p class="sum"><fmt:message key="maintain.overview.wsx"/>：<em id="count4-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.blsj"/>：<em id="yoy4-1"></em>
                                <fmt:message key="share.unit.ci"/></p>
                        </div>
                        <div class="chart fr chart-text">
                            <p class="sum"><fmt:message key="share.overview.kssl"/>：<em id="count4-2"></em> <fmt:message
                                    key="share.unit.ge"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxsbs"/><em id="yoy4-2"></em>
                                <fmt:message key="share.unit.tai"/></p>
                            <p class="line"></p>
                            <p class="sum"><fmt:message key="maintain.overview.wxfy"/>：<em id="count4-3"></em>
                                <fmt:message key="share.unit.wanyuan"/></p>
                            <p class="sum"><fmt:message key="maintain.overview.pjwxsj"/>：<em id="count4-4"></em>
                                <span><fmt:message key="share.unit.fenzhong"/></span></p>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>


                <%--图表和排名--%>
            <div class="bottom_bar" style="flex:1;">
                    <%--左边部分--%>
                <div class="list_area fl">
                        <%--图表--%>
                    <div class="border chart-border">
                        <div class="area" style="position:relative;">
                            <p class="title">
                                <span class="fl"><span class="fb spanTitle" id="moredetail"><fmt:message
                                        key="charts.title.sbxhfb"/></span></span>
                                <span class="fl option_overyear"><fmt:message key="charts.button.yfxs"/></span>
                            </p>
                            <p class="fr title quadrantContainner">
                                <span class="quadrantName"><fmt:message key="charts.button.xx"/>：</span>
                                <span class="quadrant quadrant1">1</span>
                                <span class="quadrant quadrant2">2</span>
                                <span class="quadrant quadrant3">3</span>
                                <span class="quadrant quadrant4">4</span>
                            </p>
                            <div id="swiper">
                                <div class="swiper-container">
                                    <div class="slide home-device">
                                        <div class="chartArea" id="chart" style="height:100%;"></div>

                                        <input id="currentTag" style="display:none;" value="tendency"/>
                                        <div class="pagination pagination1"></div>
                                    </div>
                                </div>
                                    <%--<span class="btn btn-left">&lt;</span>
                            <span class="btn btn-right">&gt;</span>--%>
                            </div>
                            <select id="tag">
                                <option value="0" selected="selected"><fmt:message
                                        key="charts.select.wxje-sbje"/></option>
                                <option value="1"><fmt:message key="charts.select.wywxje-nxzs"/></option>
                                <option value="2"><fmt:message key="charts.select.xjl-byl"/></option>
                                <option value="3"><fmt:message key="charts.select.pjxysj-pjwxsj"/></option>
                            </select>
                        </div>
                    </div>
                </div>
                    <%--左边结束--%>

                    <%--右侧排名--%>
                <div class="list_data fr">
                    <div class="border">
                        <div class="area">
                            <div class="data_detail">
                                <div id="top5_hospital" class="top5">
                                    <p class="title">
                                        <img src="<%=basePath%>/plugins/charts/images/yljg.png">
                                        <em id="morehospitals" class="spanTitle"><fmt:message
                                                key="share.table.head.yyks"/></em>
                                        <span>TOP5</span>
                                    </p>
                                    <p class="name"><span class="fl data_span_f"><fmt:message
                                            key="share.table.head.yyks"/></span><span
                                            class="fl listpercent data_span_s"><fmt:message
                                            key="maintainer.table.wxcs(c)"/></span><span
                                            class="fr listcontent"><fmt:message
                                            key="performance.table.sbje(wy)"/></span></p>
                                    <ul class="hospital" id="ul_hospital"></ul>
                                </div>
                                <div id="top5_type" class="top5">
                                    <p class="title">
                                        <img src="<%=basePath%>/plugins/charts/images/sblx.png">
                                        <em id="moretypes" class="spanTitle"><fmt:message
                                                key="share.table.head.sbxh"/></em>
                                        <span>TOP5</span></p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.sbxh"/></span>
                                        <span class="fl listpercent data_span_s"><fmt:message
                                                key="maintainer.table.wxcs(c)"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="performance.table.sbje(wy)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_type"></ul>
                                </div>
                                <div id="top5_brand" class="top5">
                                    <p class="title">
                                        <img src="<%=basePath%>/plugins/charts/images/sblx.png">
                                        <em id="morebrand" class="spanTitle"><fmt:message
                                                key="share.table.head.sbcj"/></em>
                                        <span>TOP5</span></p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.sbcj"/></span>
                                        <span class="fl listpercent data_span_s"><fmt:message
                                                key="maintainer.table.wxcs(c)"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="performance.table.sbje(wy)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_brand"></ul>
                                </div>
                                <div id="top5_maintainer" class="top5">
                                    <p class="title">
                                        <img src="<%=basePath%>/plugins/charts/images/sblx.png">
                                        <em id="moremaintainer" class="spanTitle"><fmt:message
                                                key="share.table.head.wxs"/></em>
                                        <span>TOP5</span></p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.wxs"/></span>
                                        <span class="fl listpercent data_span_s"><fmt:message
                                                key="maintainer.table.wxcs(c)"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="performance.table.sbje(wy)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_maintainer"></ul>
                                </div>

                                <div id="top5_year" class="top5" style="display:none;">
                                    <p class="title">
                                        <em id="moreyears" class="spanTitle" onclick="moreyear()"><fmt:message
                                                key="charts.button.yfxs"/></em>
                                    </p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.yf"/></span>
                                        <span class="fl listpercent data_span_s"><fmt:message
                                                key="maintainer.table.wxcs(c)"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="performance.table.sbje(wy)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_year"></ul>
                                </div>
                                <div id="top5_device" class="top5">
                                    <p class="title">
                                        <em id="moredevices" class="spanTitle"><fmt:message
                                                key="share.table.head.jtsb"/></em>
                                        <span>TOP5</span></p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.sbmc"/></span>
                                        <span class="fl listpercent data_span_s"><fmt:message
                                                key="maintainer.table.wxcs(c)"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="performance.table.sbje(wy)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_device"></ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                    <%--右侧结束--%>
            </div>
        </div>
        <div class="baseline"></div>
            <%--详情图表模态框--%>
        <div id="modal" style="display:none">
            <div class="row">
                <div class="col-md-12">
                    <div class="box-body no-padding">
                        <table id="tblSort" class="table table-bordered table-striped table-hover table-responsive">
                            <tbody id="table_data">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div id="typeModal" class="modal" style="display:none;padding-top: 58px;height: 100%;box-sizing: border-box;">
            <div class="row">
                <div class="col-md-12">
                    <div class="box-body no-padding">
                        <table id="typeTable" class="table table-bordered table-striped table-hover table-responsive">
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

        <%-- JS部分 --%>
    <script src="<%=basePath%>/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="<%=basePath%>/plugins/jQuery/jquery.cookie.js"></script>
    <script src="<%=basePath%>/plugins/fastclick/fastclick_1.0.6.min.js"></script>
    <script src="<%=basePath%>/plugins/flavr/flavr.min.js"></script>
    <script src="<%=basePath%>/plugins/charts/js/echarts.min.js"></script>
    <!-- 引入 macarons 主题 -->
    <script src="<%=basePath%>/echarts/customed.js"></script>
    <script src="<%=basePath%>/plugins/select2/select2.full.min.js"></script>
    <script src="<%=basePath%>/plugins/select2/i18n/zh-CN.js"></script>
    <script src="<%=basePath%>/plugins/iziModal/js/iziModal.min.js"></script>
    <script src="<%=basePath%>/plugins/iCheck/icheck.min.js"></script>
    <script src="<%=basePath%>/plugins/jQuery/JQMeter.min.js"></script>
    <script src="<%=basePath%>/plugins/charts/js/plugins.js"></script>
    <script src="<%=basePath%>/plugins/charts/js/tableHeadFixer.js"></script>
    <script>
        /*--------- 全局变量 ---------*/
        var CONST = 1000000;
        var basePath = '<%=basePath%>';
        var modelName = '';
        var maintainSize = '';
        var title = '0';
        var listcontentWidth = $('.listcontent').eq(0).width();
        /*--------- 全局变量 ---------*/

        /* 页面初始化 */
        $(function () {
            loading(function () {
                addChooseRadioEvent('hospital');
                resizeWindow();
                initChart();  // 初始化图表
                ChooseBox.siblingsClick();
                querySearch("hospital", '');
                querySearch("risk", '');
                querySearch("type", '');
                querySearch("brand", '');
                querySearch("year", '');
                getParams();
                appendTime();
                clickChange($('.detail .title em'));
                clickToggle($('.quadrant'));
                $("#btn5").click(function () {
                    ChooseBox.toggle();
                });

                $('#tag').select2();
                $('#tag').on('change', function (e) {
                    title = $(this).val();
                    showYearTop5();
                    setChatsData(title);
                    setUlHospital('desc', 0);
                    setUlType('desc', 0);
                    setUlBrand('desc', 0);
                    setUlMaintainer('desc', 0);
                    setUlDevice('desc', 0);
                });
            });
        });

        $('#title1').click(function () {
            loading(function () {
                maintainSize = '';
                queryChartsData();
                queryTypeTop5Data();
                queryBrandTop5Data();
                queryMaintainerTop5Data();
                queryDeviceTop5Data();
                $('#tag').next().show();
                $('.quadrantContainner').show();
                $('.quadrant').removeClass('active');
                showYearTop5();
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                $('#moredetail').html('<fmt:message key="charts.title.yyksfb"/>').off().on('click', moretypes);
            });
        });
        $('#title2').click(function () {
            loading(function () {
                maintainSize = 1;
                queryChartsData();
                queryTypeTop5Data();
                queryBrandTop5Data();
                queryMaintainerTop5Data();
                queryDeviceTop5Data();
                $('#tag').next().show();
                $('.quadrantContainner').show();
                $('.quadrant').removeClass('active');
                showYearTop5();
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                $('#moredetail').html('<fmt:message key="charts.title.yyksfb"/>').off().on('click', moretypes);
            });
        });
        $('#title3').click(function () {
            loading(function () {
                maintainSize = 2;
                queryChartsData();
                queryTypeTop5Data();
                queryBrandTop5Data();
                queryMaintainerTop5Data();
                queryDeviceTop5Data();
                $('#tag').next().show();
                $('.quadrantContainner').show();
                $('.quadrant').removeClass('active');
                showYearTop5();
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                $('#moredetail').html('<fmt:message key="charts.title.yyksfb"/>').off().on('click', moretypes);
            });
        });
        $('#title4').click(function () {
            loading(function () {
                maintainSize = 3;
                queryChartsData();
                queryTypeTop5Data();
                queryBrandTop5Data();
                queryMaintainerTop5Data();
                queryDeviceTop5Data();
                $('#tag').next().show();
                $('.quadrantContainner').show();
                $('.quadrant').removeClass('active');
                showYearTop5();
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                $('#moredetail').html('<fmt:message key="charts.title.yyksfb"/>').off().on('click', moretypes);
            });
        });

        // 初始化图表并添加图表点击事件
        function initChart() {
            chart = echarts.init(document.getElementById('chart'), 'customed');  // 初始化echarts实例
            chart.on("click", click);
        }


        var bj = true;

        //图表鼠标悬浮，右侧列表对应记录高亮
        function hoverChart(param) {
            /*//气泡图
        if(param.componentSubType == "scatter"){
            for(var i = 0; i < aDOM.length; i ++){
                if(param.data[3] === aDOM.eq(i).attr('title')){
                    aDOM.eq(i).addClass('active');
                } else{
                    aDOM.eq(i).removeClass('active');
                }
            }
        } else if(param.componentType == "markLine"){
            return;
        } else{
            for(var i = 0; i < aDOM.length; i ++){
                if(param[0].axisValue === aDOM.eq(i).attr('title')){
                    aDOM.eq(i).addClass('active');
                } else{
                    aDOM.eq(i).removeClass('active');
                }
            }
        }*/
        }

        var optionBTemp, optionBTempTemp;
        var queryStatus = {
            arr: ['hospital', 'model', 'brand', 'maintainer', 'assets'],
            getStatus: function () {
                for (var i = 0; i < this.arr.length; i++) {
                    if (!this[this.arr[i]]) return false;
                }
                return true;
            },
            resetStatus: function () {
                for (var i = 0; i < this.arr.length; i++) {
                    this[this.arr[i]] = false;
                }
            }
        };
        function click(param) {
            if (typeof param.seriesIndex === 'undefined') {
                return;
            }
            if (param.componentType === 'markLine') {
                return;
            }
            loading();
            if (param.type === 'click') {
                var index = param.dataIndex;
                seriesIndex = param.seriesIndex;
                if ($('.option_overyear').hasClass('active')) {
                    loading(true);
                    return;
                    $('.select_year').val(idsB[index]).trigger('change');
                    $('.option_overyear').removeClass('active');
                    getParams();
                } else {
                    var tab;
                    if (modelName == idsType[index]) {
                        modelName = '';
                        tab = false;
                        index = 0;
                    } else {
                        modelName = idsType[index];
                        tab = true;
                    }

                    if (title == 2) {
                        if (copySatus) {
                            optionBTemp = $.extend(true, {}, optionB);
                            optionBTempTemp = $.extend(true, {}, optionB);
                        } else {
                            optionBTemp = {};
                            optionBTemp = $.extend(true, {}, optionBTempTemp);
                        }
                        copySatus = false;
                        if (optionBTemp.series[seriesIndex].type == 'bar') {
                            optionBTemp.series[seriesIndex].itemStyle.normal.opacity = 1;
                        } else if (optionBTemp.series[seriesIndex].type == 'line') {
                            optionBTemp.series[seriesIndex].lineStyle.normal.width = 4;
                            optionBTemp.series[seriesIndex].z = 10;
                        }
                        chart.setOption(optionBTemp);
                    }

                    setUlType('desc', index, tab);
                    queryStatus.model = true;
                    queryChartsData();
                    queryBrandTop5Data();
                    queryMaintainerTop5Data();
                    queryDeviceTop5Data();
                }
            }
        }

        //按月显示
        $('.option_overyear').click(function () {
            if ($(this).hasClass('active')) {
                $('#moredetail').html('<fmt:message key="charts.title.sblxfb"/>').off().on('click', moretypes);
                $(this).html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                showYearTop5();
                if (title == 0 || title == 1) {
                    chart.clear();
                    chart.setOption(optionAgelimit);
                } else if (title == 2) {
                    chart.clear();
                    chart.setOption(optionB);
                } else if (title == 3) {
                    chart.clear();
                    chart.setOption(optionB2);
                }
                $('#tag').next().show();
                if (title < 2) {
                    $('.quadrantContainner').show();
                    $('.quadrant').removeClass('active');
                }
            } else {
                $('#tag').next().hide();
                $('.quadrantContainner').hide();
                $(this).html('<fmt:message key="charts.button.qbxs"/>').addClass('active');
                loading(function () {
                    xAxisB = [];
                    idsB = [];
                    curBigRepairCountsB = [];       // 大维修次数
                    curMiddleRepairCountsB = [];    // 中维修次数
                    curSmallRepairCountsB = [];     // 小维修次数
                    curToRepairCountsB = [];        // 保修次数
                    curRepairedCountsB = [];        // 已修复次数
                    curFaultCountsB = [];           // 不良事件
                    curEstimateLabourCostB = [];    // 人工费用
                    curEstimatePartCostB = [];      // 备件费用
                    curEstimateTotalCostB = [];      // 维修费用
                    curInspectionRateB = [];        // 巡检率
                    curUpkeepRateB = [];            // 保养率
                    toRepairCountsYoyB = [];         // 维修次数同比
                    curAgeLimitMeasureB = [];
                    curEstimateCostWanyuanB = [];
                    curAvgRepairUsedMinB = [];
                    curAvgResponseMinB = [];
                    $("#ul_year").html('');
                    showYearTop5(true);

                    yearJson = [];
                    $('#moredetail').html('<fmt:message key="charts.button.yfxs"/>').off().on('click', moreyear);
                    $.ajax({
                        url: '<%=basePath%>/charts/hospital/model-maintain/month-trend',
                        data: {
                            hospitalId: hspId,
                            departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                            riskId: riskId ? JSON.stringify(riskId) : '',
                            typeId: typeId ? JSON.stringify(typeId) : '',
                            brandId: brandId ? JSON.stringify(brandId) : '',
                            year: year ? JSON.stringify(year) : '',
                            monthId: monthId ? JSON.stringify(monthId) : '',
                            enableYearStart: enableYearStart,
                            enableYearEnd: enableYearEnd,
                            priceStart: priceStart,
                            priceEnd: priceEnd,
                            ageLimitStart: ageLimitStart,
                            ageLimitEnd: ageLimitEnd
                        },
                        type: 'post',
                        success: function (data) {
                            if (data.ret) {
                                data.data = data.data || {list: []};
                                yearJson = data.data.list;
                                for (var i = 0; i < data.data.list.length; i++) {
                                    xAxisB.push(data.data.list[i].name || '');
                                    idsB.push(data.data.list[i].id || '');
                                    curBigRepairCountsB.push(data.data.list[i].curBigRepairCounts || 0);
                                    curMiddleRepairCountsB.push(data.data.list[i].curMiddleRepairCounts || 0);
                                    curSmallRepairCountsB.push(data.data.list[i].curSmallRepairCounts || 0);
                                    curToRepairCountsB.push(data.data.list[i].curToRepairCounts || 0);
                                    curRepairedCountsB.push(data.data.list[i].curRepairedCounts || 0);
                                    curFaultCountsB.push(data.data.list[i].curFaultCounts || 0);
                                    curEstimateLabourCostB.push(parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2));
                                    curEstimatePartCostB.push(parseFloat((data.data.list[i].curEstimatePartCost / CONST) || 0).toFixed(2));
                                    curEstimateTotalCostB.push(parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2));
                                    curInspectionRateB.push(parseFloat(data.data.list[i].curInspectionRate || 0).toFixed(2));
                                    curUpkeepRateB.push(parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2));
                                    toRepairCountsYoyB.push(parseFloat(data.data.list[i].toRepairCountsYoy || 0).toFixed(2));
                                    curAgeLimitMeasureB.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                                    curEstimateCostWanyuanB.push(parseFloat(data.data.list[i].curEstimateCostWanyuan || 0).toFixed(2));
                                    curAvgRepairUsedMinB.push(data.data.list[i].curAvgRepairUsedMin || 0);
                                    curAvgResponseMinB.push(data.data.list[i].curAvgResponseMin || 0);

                                    if (true || title == 0) {
                                        $("#ul_year").append(
                                            '<li><a><span class="fl data_span_f">' + data.data.list[i].name + '</span><em class="fl data_span_s">'
                                            + (data.data.list[i].curToRepairCounts || 0) + '</em><em class="fr">'
                                            + parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2) + '</em></a></li>');
                                    } else if (title == 1) {
                                        $("#ul_year").append(
                                            '<li><a><span class="fl data_span_f">' + data.data.list[i].name + '</span><em class="fl data_span_s">'
                                            + parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2) + '</em><em class="fr">'
                                            + parseFloat(data.data.list[i].curEstimateCostWanyuan || 0).toFixed(2) + '</em></a></li>');
                                    } else if (title == 2) {
                                        $("#ul_year").append(
                                            '<li><a><span class="fl data_span_f">' + data.data.list[i].name + '</span><em class="fl data_span_s">'
                                            + parseFloat(data.data.list[i].curInspectionRate || 0).toFixed(2) + '</em><em class="fr">'
                                            + parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2) + '</em></a></li>');
                                    } else if (title == 3) {
                                        $("#ul_year").append(
                                            '<li><a><span class="fl data_span_f">' + data.data.list[i].name + '</span><em class="fl data_span_s jqmeter">'
                                            + (data.data.list[i].curAvgResponseMin || 0) + '</em><em class="fr jqmeter">'
                                            + (data.data.list[i].curAvgRepairUsedMin || 0) + '</em></a></li>');
                                    }
                                }

                                if (title == 2) { // 当选择巡检率、保养率时，TOP5显示进度条
                                    $('#ul_year .jqmeter').each(function () {
                                        $(this).jQMeter({
                                            goal: '$1,00',
                                            raised: '$' + Math.round($(this).text()),
                                            width: listcontentWidth - 20 + 'px',
                                            height: '0.24rem'
                                        });
                                    });
                                }

                                optionB1.xAxis.data = xAxisB;
                                optionB1.series[0].data = curBigRepairCountsB;
                                optionB1.series[1].data = curMiddleRepairCountsB;
                                optionB1.series[2].data = curSmallRepairCountsB;
                                optionB1.series[3].data = curToRepairCountsB;
                                optionB1.series[4].data = curFaultCountsB;
                                optionB1.series[5].data = curEstimateLabourCostB;
                                optionB1.series[6].data = curEstimatePartCostB;
                                optionB1.series[7].data = curEstimateTotalCostB;
                                optionB1.series[8].data = curInspectionRateB;
                                optionB1.series[9].data = curUpkeepRateB;
                                optionB1.series[10].data = toRepairCountsYoyB;
                                chart.clear();
                                chart.setOption(optionB1);
                            } else {
                                flavrShowByTime(data.msg, null, "danger", false);
                            }
                            loading(true);
                        },
                        failure: function (data) {
                            flavrShowByTime(data.msg, null, "danger", false);
                        }
                    });
                });
            }
        });

        function moreyear() {
            loading(function () {
                var sb = new StringBuffer();
                $("#tblSort").html('<tbody id="table_data"></tbody>');
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.yf"/></th>");

                //表格内容
                sb.append("<th class='text-right'><fmt:message key="maintain.table.dwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.zwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.xwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxsbsl(t)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintainer.assets.zgzsj(fz)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintainer.assets.pjgzsj(fz)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintainer.assets.djcs(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintainer.assets.pjdjsj(fz)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintian.record.bjghcs"/></th>"
                    + "<th class='text-right'><fmt:message key="maintainer.table.pjwxsj(fz)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintainer.table.wxcs(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.blsj(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintian.assets.rgfy(wy)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintian.assets.bjfy(wy)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintian.assets.zwxfy(wy)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.xjl(%)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.byl(%)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxcstb(%)"/></th>"
                    + "</tr></thead>");
                $("#tblSort").prepend(sb.toString());
                for (var i = 0; i < xAxisB.length; i++) {
                    $("#table_data").append("<tr>"
                        + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                        + "<td class='no-cal text-left spanTitle' onclick=\"query('year','" + idsB[i] + "')\">" + xAxisB[i] + "</td>"
                        + "<td class='total-1 text-right" + (yearJson[i].curBigRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{monthId:" + yearJson[i].id + ",maintainSize:1}'," + yearJson[i].curBigRepairCounts + ")\">" + curBigRepairCountsB[i] + "</td>"
                        + "<td class='total-2 text-right" + (yearJson[i].curMiddleRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{monthId:" + yearJson[i].id + ",maintainSize:2}'," + yearJson[i].curMiddleRepairCounts + ")\">" + curMiddleRepairCountsB[i] + "</td>"
                        + "<td class='total-3 text-right" + (yearJson[i].curSmallRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{monthId:" + yearJson[i].id + ",maintainSize:3}'," + yearJson[i].curSmallRepairCounts + ")\">" + curSmallRepairCountsB[i] + "</td>"
                        + "<td class='total-12 text-right" + (yearJson[i].curRepairedDeviceCounts ? ' spanTitle' : '') + "' onclick=\"query('repair','{monthId:" + yearJson[i].id + "}'," + yearJson[i].curRepairedDeviceCounts + ")\">" + (yearJson[i].curRepairedDeviceCounts || 0) + "</td>"
                        + "<td class='total-13 text-right'>" + (yearJson[i].curTotalFaultMin || 0) + "</td>"
                        + "<td class='avg-14 text-right'>" + (yearJson[i].curAvgFaultMin || 0) + "</td>"
                        + "<td class='total-15 text-right" + (yearJson[i].curHaltCounts ? ' spanTitle' : '') + "' onclick=\"query('halt','{monthId:" + yearJson[i].id + "}'," + yearJson[i].curHaltCounts + ")\">" + (yearJson[i].curHaltCounts || 0) + "</td>"
                        + "<td class='total-16 text-right'>" + (yearJson[i].curAvgHaltMin || 0) + "</td>"
                        + "<td class='total-18 text-right'>" + (yearJson[i].curPartChangeCounts || 0) + "</td>"
                        + "<td class='avg-17 text-right'>" + (yearJson[i].curAvgRepairUsedMin || 0) + "</td>"
                        + "<td class='total-4 text-right'>" + curToRepairCountsB[i] + "</td>"
                        + "<td class='total-6 text-right'>" + curFaultCountsB[i] + "</td>"
                        + "<td class='total-7 text-right'>" + parseFloat(curEstimateLabourCostB[i]).toFixed(2) + "</td>"
                        + "<td class='total-8 text-right'>" + parseFloat(curEstimatePartCostB[i]).toFixed(2) + "</td>"
                        + "<td class='total-9 text-right'>" + parseFloat(curEstimateTotalCostB[i]).toFixed(2) + "</td>"
                        + "<td class='avg-1 text-right'>" + parseFloat(curInspectionRateB[i]).toFixed(2) + "</td>"
                        + "<td class='avg-2 text-right'>" + parseFloat(curUpkeepRateB[i]).toFixed(2) + "</td>"
                        + "<td class='avg-3 text-right yoy'>" + parseFloat(toRepairCountsYoyB[i]).toFixed(2) + "</td>"
                        + "</tr>");
                }
                calTableData("tblSort", true);
                $('#modal').iziModal('setTitle', '<fmt:message key="share.table.title.yffb"/>');
                $('#modal').iziModal('open', this);
                loading(true);
            });
        }

        //查询筛选条件
        var typeIdArr;

        function querySearch(tag, tagId) {
            var url = "<%=basePath%>/hospital/search/" + (tag == 'hospital' ? 'department' : tag);
            $.ajax({
                type: "POST",
                data: {
                  hospitalId: hspId},
                url: url,
                async: false,
                dataType: "json",
                success: function (data) {
                    if (data.ret == 1) {
                        data.data = data.data || {list: []};
                        var searchData = data.data;
                        setSearch(tag, searchData);
                        $('.select_' + tag).select2({
                            placeholder: '<fmt:message key="share.sift.qxz"/>',
                            allowClear: true
                        });
                        ChooseBox.setSearchFromCookie(tag);
                        if (tag == 'type') {
                            searchDataGlobal = searchData;
                            $('.select_type').on('select2:select', function (param) {
                                typeIdArr = $('.select_type').val();
                                var id = param.params.data.id;
                                if (id < 2016102346) {
                                    for (var i = 0; i < searchDataGlobal[id].length; i++) {
                                        typeIdArr.push(searchDataGlobal[id][i].id)
                                    }
                                }
                                $('.select_type').val(typeIdArr).trigger('change');
                            });
                            $('.select_type').on('select2:unselect', function (param) {
                                typeIdArr = $('.select_type').val();
                                var id = param.params.data.id;
                                typeIdArr.removeByValue(id);
                                if (id < 2016102346) {
                                    for (var i = 0; i < searchDataGlobal[id].length; i++) {
                                        typeIdArr.removeByValue(searchDataGlobal[id][i].id)
                                    }
                                }
                                $('.select_type').val(typeIdArr).trigger('change');
                            });
                        }
                        if (tag == 'type' && window.location.search.split('=')[1]) {
                            typeId = GetQueryString('typeId') ? [GetQueryString('typeId')] : '';
                            $('.select_type').val(typeId).trigger('change');
                        }
                    } else {
                        if (data.msg == '该用户不存在') {
                            location.href = '<%=basePath%>';
                        } else {
                            flavrShowByTime(data.msg, null, "danger", false);
                        }
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        /* 设置搜索框搜索条件 */
        function setSearch(tag, data) {
            var first, second, id, str, str1;
            if (tag === "type") {
                str = '';
                first = data.first;
                for (var i = 0; i < first.length; i++) {
                    //一级设备
                    if ('${sessionScope.locale}'.indexOf('en') != -1) {
                        str += '<optgroup label="' + (first[i].enName || "") + '">' +
                            (function () {
                                str1 = '';
                                id = first[i].id;
                                if (data[id]) {
                                    //一级设备
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].enName || "") + '</option>';
                                    second = data[id];
                                    for (var j = 0; j < second.length; j++) {
                                        //二级设备
                                        str1 += '<option value="' + second[j].id + '">' + (second[j].enName || "") + '</option>';
                                    }
                                } else {
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].enName || "") + '</option>';
                                }
                                return str1;
                            })() +
                            '</optgroup>';
                    } else {
                        str += '<optgroup label="' + (first[i].name || "") + '">' +
                            (function () {
                                str1 = '';
                                id = first[i].id;
                                if (data[id]) {
                                    //一级设备
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].name || "") + '</option>';
                                    second = data[id];
                                    for (var j = 0; j < second.length; j++) {
                                        //二级设备
                                        str1 += '<option value="' + second[j].id + '">' + (second[j].name || "") + '</option>';
                                    }
                                } else {
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].name || "") + '</option>';
                                }
                                return str1;
                            })() +
                            '</optgroup>';
                    }
                }
                $(".select_type").append(str);
            } else {
                data = data.list;
                if (tag == 'department') {
                    if ('${sessionScope.locale}'.indexOf('en') != -1) {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + 'hospital').append('<option value="' + data[i].id + '">' + (data[i].enName || "") + '</option>');
                        }
                    } else {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + 'hospital').append('<option value="' + data[i].id + '">' + (data[i].name || "") + '</option>');
                        }
                    }
                } else {
                    if ('${sessionScope.locale}'.indexOf('en') != -1) {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + tag).append('<option value="' + data[i].id + '">' + (data[i].enName || "") + '</option>');
                        }
                    } else {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + tag).append('<option value="' + data[i].id + '">' + (data[i].name || "") + '</option>');
                        }
                    }
                }
            }

        }

        //全市详情
        function queryAllAssets() {
            $.ajax({
                type: "POST",
                url: "<%=basePath%>/charts/hospital/model-maintain/overview",
                async: true,
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret == 1) {
                        data.data = data.data || {list: []};
                        data = data.data;
                        assets = data;
                        // 维修数 及 不良事件
                        $('#count1-1').html(data.allAssets.curToRepairCounts || 0);
                        $('#yoy1-1').html((data.list[0].curFaultCounts || 0) + (data.list[1].curFaultCounts || 0) + (data.list[2].curFaultCounts || 0));
                        // 医院数量 及 维修设备
                        $('#count1-2').html(data.allAssets.curHospitalCounts || 0);
                        $('#yoy1-2').html(data.allAssets.curRepairedDeviceCounts || 0);
                        // 维修费用 及 人工费用
                        $('#count1-3').html(parseFloat((data.allAssets.curEstimateTotalCost / CONST) || 0).toFixed(2));
                        changeTime($('#count1-4'), (data.allAssets.curAvgRepairUsedMin || 0));

                        // 维修数 及 不良事件
                        $('#count2-1').html(data.list[0].curToRepairCounts || 0);
                        $('#yoy2-1').html(data.list[0].curFaultCounts || 0);
                        // 医院数量 及 维修设备
                        $('#count2-2').html(data.list[0].curHospitalCounts || 0);
                        $('#yoy2-2').html(data.list[0].curRepairedDeviceCounts || 0);
                        // 维修费用 及 人工费用
                        $('#count2-3').html(parseFloat((data.list[0].curEstimateTotalCost / CONST) || 0).toFixed(2));
                        changeTime($('#count2-4'), (data.list[0].curAvgRepairUsedMin || 0));

                        // 维修数 及 不良事件
                        $('#count3-1').html(data.list[1].curToRepairCounts || 0);
                        $('#yoy3-1').html(data.list[1].curFaultCounts || 0);
                        // 医院数量 及 维修设备
                        $('#count3-2').html(data.list[1].curHospitalCounts || 0);
                        $('#yoy3-2').html(data.list[1].curRepairedDeviceCounts || 0);
                        // 维修费用 及 人工费用
                        $('#count3-3').html(parseFloat((data.list[1].curEstimateTotalCost / CONST) || 0).toFixed(2));
                        changeTime($('#count3-4'), (data.list[1].curAvgRepairUsedMin || 0));

                        // 维修数 及 不良事件
                        $('#count4-1').html(data.list[2].curToRepairCounts || 0);
                        $('#yoy4-1').html(data.list[2].curFaultCounts || 0);
                        // 医院数量 及 维修设备
                        $('#count4-2').html(data.list[2].curHospitalCounts || 0);
                        $('#yoy4-2').html(data.list[2].curRepairedDeviceCounts || 0);
                        // 维修费用 及 人工费用
                        $('#count4-3').html(parseFloat((data.list[2].curEstimateTotalCost / CONST) || 0).toFixed(2));
                        changeTime($('#count4-4'), (data.list[2].curAvgRepairUsedMin || 0));
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            });
        }

        //医院top5
        function setUlHospital(sortord, index, tab) {
            index = index ? index : 0;
            var len = xAxis.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_hospital").html('');
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = curToRepairCounts[i] || 0;
                    count = parseFloat(curDevicePrice[i]).toFixed(2);
                } else if (title == 1) {
                    percent = parseFloat(curAgeLimitMeasure[i] || 0).toFixed(2);
                    count = parseFloat(curEstimateCostWanyuan[i]).toFixed(2);
                } else if (title == 2) {
                    percent = parseFloat(curInspectionRate[i] || 0).toFixed(2);
                    count = parseFloat(curUpkeepRate[i]).toFixed(2);
                } else if (title == 3) {
                    percent = curAvgResponseMin[i] || 0;
                    count = curAvgRepairUsedMin[i] || 0;
                }
                $("#ul_hospital").append(
                    '<li><a title="' + (i + 1) + ' ' + fullName[i] + '"' + ((tab && i == index) ? 'class="active"' : '') + ' onclick="query(\'hospital\',\''+ids[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxis[i] + '</span><em class="fl data_span_s jqmeter">'
                    + percent + '</em><em class="fr">'
                    + count + '</em></a></li>');
            }
            if (title == 2) { // 当选择巡检率、保养率时，TOP5显示进度条
                $('#ul_hospital .jqmeter').each(function () {
                    $(this).jQMeter({
                        goal: '$1,00',
                        raised: '$' + Math.round($(this).text()),
                        width: listcontentWidth - 20 + 'px',
                        height: '0.24rem'
                    });
                });
            }
        }

        //设置与图表对应的表的内容
        function setUlType(sortord, index, tab) {
            index = index ? index : 0;
            var len = xAxisType.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_type").html('');
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = curToRepairCountsType[i] || 0;
                    count = parseFloat(curDevicePriceType[i]).toFixed(2);
                } else if (title == 1) {
                    percent = parseFloat(curAgeLimitMeasureType[i] || 0).toFixed(2);
                    count = parseFloat(curEstimateCostWanyuanType[i]).toFixed(2);
                } else if (title == 2) {
                    percent = parseFloat(curInspectionRateType[i] || 0).toFixed(2);
                    count = parseFloat(curUpkeepRateType[i]).toFixed(2);
                } else if (title == 3) {
                    percent = curAvgResponseMinType[i] || 0;
                    count = curAvgRepairUsedMinType[i] || 0;
                }
                $("#ul_type").append(
                    '<li><a title="' + (i + i) + ' ' + fullNameType[i] + '"' + ((tab && i == index) ? 'class="active"' : '') + ' onclick="query(\'type\',\''+idsType[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisType[i] + '</span><em class="fl data_span_s jqmeter">'
                    + percent + '</em><em class="fr">'
                    + count + '</em></a></li>'
                );
            }
            if (title == 2) { // 当选择巡检率、保养率时，TOP5显示进度条
                $('#ul_type .jqmeter').each(function () {
                    $(this).jQMeter({
                        goal: '$1,00',
                        raised: '$' + Math.round($(this).text()),
                        width: listcontentWidth - 20 + 'px',
                        height: '0.24rem'
                    });
                });
            }
        }

        //设备厂家top5
        function setUlBrand(sortord, index) {
            index = index ? index : 0;
            var len = xAxisBrand.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_brand").html('');
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = curToRepairCountsBrand[i] || 0;
                    count = parseFloat(curDevicePriceBrand[i]).toFixed(2);
                } else if (title == 1) {
                    percent = parseFloat(curAgeLimitMeasureBrand[i] || 0).toFixed(2);
                    count = parseFloat(curEstimateCostWanyuanBrand[i]).toFixed(2);
                } else if (title == 2) {
                    percent = parseFloat(curInspectionRateBrand[i] || 0).toFixed(2);
                    count = parseFloat(curUpkeepRateBrand[i]).toFixed(2);
                } else if (title == 3) {
                    percent = curAvgResponseMinBrand[i] || 0;
                    count = curAvgRepairUsedMinBrand[i] || 0;
                }
                $("#ul_brand").append(
                    '<li><a title="' + (i + i) + ' ' + fullNameBrand[i] + '" onclick="query(\'brand\',\''+idsBrand[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisBrand[i] + '</span><em class="fl data_span_s jqmeter">'
                    + percent + '</em><em class="fr">'
                    + count + '</em></a></li>');
            }
            if (title == 2) { // 当选择巡检率、保养率时，TOP5显示进度条
                $('#ul_brand .jqmeter').each(function () {
                    $(this).jQMeter({
                        goal: '$1,00',
                        raised: '$' + Math.round($(this).text()),
                        width: listcontentWidth - 20 + 'px',
                        height: '0.24rem'
                    });
                });
            }
        }


        //维修商top5
        function setUlMaintainer(sortord, index) {
            index = index ? index : 0;
            var len = xAxisMaintainer.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_maintainer").html('');
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = curToRepairCountsMaintainer[i] || 0;
                    count = parseFloat(curEstimateTotalCostMaintainer[i]).toFixed(2);
                } else if (title == 1) {
                    percent = parseFloat(curAgeLimitMeasureMaintainer[i] || 0).toFixed(2);
                    count = parseFloat(curEstimateCostWanyuanMaintainer[i]).toFixed(2);
                } else if (title == 2) {
                    percent = parseFloat(curInspectionRateMaintainer[i] || 0).toFixed(2);
                    count = parseFloat(curUpkeepRateMaintainer[i]).toFixed(2);
                } else if (title == 3) {
                    percent = curAvgResponseMinMaintainer[i] || 0;
                    count = curAvgRepairUsedMinMaintainer[i] || 0;
                }
                $("#ul_maintainer").append(
                    '<li><a title="' + xAxisMaintainer[i] + '" onclick="query(\'maintainer\',\''+idsMaintainer[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisMaintainer[i] + '</span><em class="fl data_span_s jqmeter">'
                    + percent + '</em><em class="fr">'
                    + count + '</em></a></li>');
            }
            if (title == 2) { // 当选择巡检率、保养率时，TOP5显示进度条
                $('#ul_maintainer .jqmeter').each(function () {
                    $(this).jQMeter({
                        goal: '$1,00',
                        raised: '$' + Math.round($(this).text()),
                        width: listcontentWidth - 20 + 'px',
                        height: '0.24rem'
                    });
                });
            }
        }

        function setUlDevice(sortord, index) {
            index = index ? index : 0;
            var len = xAxisDevice.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_device").html('');
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = curToRepairCountsDevice[i] || 0;
                    count = parseFloat(curEstimateTotalCostDevice[i]).toFixed(2);
                } else if (title == 1) {
                    percent = parseFloat(ageLimitMeasureDevice[i] || 0).toFixed(2);
                    count = parseFloat(curEstimateCostWanyuanDevice[i]).toFixed(2);
                } else if (title == 2) {
                    percent = parseFloat(curIntactRatioDevice[i] || 0).toFixed(2);
                    count = parseFloat(curUpkeepRateDevice[i]).toFixed(2);
                } else if (title == 3) {
                    percent = curAvgResponseMinDevice[i] || 0;
                    count = curAvgRepairUsedMinDevice[i] || 0;
                }
                $("#ul_device").append(
                    '<li><a title="' + (i + 1) + ' ' + fullNameDevice[i] + '" onclick="query(\'device\',\''+idsDevice[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisDevice[i] + '</span><em class="fl data_span_s jqmeter">'
                    + percent + '</em><em class="fr">'
                    + count + '</em></a></li>');
            }
            if (title == 2) { // 当选择巡检率、保养率时，TOP5显示进度条
                $('#ul_device .jqmeter').each(function () {
                    $(this).jQMeter({
                        goal: '$1,00',
                        raised: '$' + Math.round($(this).text()),
                        width: listcontentWidth - 20 + 'px',
                        height: '0.24rem'
                    });
                });
            }
        }


        //获取筛选条件参数
        function getParams() {
            loading(function () {
                $('#tag').next().show();
                $('.quadrantContainner').show();
                $('.quadrant').removeClass('active');
                showYearTop5();
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                $('#moredetail').html('<fmt:message key="charts.title.sbxhfb"/>').off().on('click', moretypes);

                hospitalId = $('.select_hospital').val() ? $('.select_hospital').val() : '';
                riskId = $('.select_risk').val() ? $('.select_risk').val() : '';
                typeId = $('.select_type').val() ? $('.select_type').val() : '';
                brandId = $('.select_brand').val() ? $('.select_brand').val() : '';
                year = $('.select_year').val() ? $('.select_year').val() : '';
                monthId = $('.select_month').val() ? $('.select_month').val() : '';
                enableYearStart = $('#enableYearStart').val() ? $('#enableYearStart').val() : '';
                enableYearEnd = $('#enableYearEnd').val() ? $('#enableYearEnd').val() : '';
                priceStart = $('#priceStart').val() ? $('#priceStart').val() * CONST : '';
                priceEnd = $('#priceEnd').val() ? $('#priceEnd').val() * CONST : '';
                ageLimitStart = $('#ageLimitStart').val() ? $('#ageLimitStart').val() : '';
                ageLimitEnd = $('#ageLimitEnd').val() ? $('#ageLimitEnd').val() : '';

                var oldParams = JSON.parse($.cookie('chooseValue') || '{}');
                $.cookie('chooseValue', JSON.stringify({
                    hospitalId: hospitalId,
                    riskId: riskId,
                    typeId: GetQueryString('typeId') ? oldParams.typeId : typeId,
                    brandId: GetQueryString('brandId') ? oldParams.brandId : brandId,
                    year: year,
                    monthId: monthId,
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd
                }), {path: '/'});

                queryAllAssets();
                queryChartsData();
                queryTypeTop5Data();
                queryBrandTop5Data();
                queryMaintainerTop5Data();
                queryDeviceTop5Data();
            });
        }

        // 获取图表数据(医院)
        function queryChartsData(tableId) {
            ids = [];
            xAxis = [];
            curHospitalCounts = [];         // 医院数量
            curDevicePrice = [];            // 设备金额
            curAgeLimitMeasure = [];        // 年限指数
            curFaultCounts = [];            // 高危故障数
            curEstimateCostWanyuan = [];    // 万元维修费用
            curUpkeepRate = [];             // 保养率
            curInspectionRate = [];         // 巡检率
            curEstimateLabourCost = [];     // 人工费用
            curEstimateTotalCost = [];     // 维修费用
            curBigRepairCounts = [];        // 大维修数量
            curMiddleRepairCounts = [];     // 中维修数量
            curSmallRepairCounts = [];      // 小维修数量
            curToRepairCounts = [];         // 维修次数
            curIntactRatio = [];            // 完好率
            curHaltHours = [];              //  宕机时间
            fullName = [];
            curAvgResponseMin = [];
            curAvgRepairUsedMin = [];

            hospitalJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/model-maintain/department',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    modelName: modelName,
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintainSize: maintainSize
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        hospitalJson = data.data.list;
                        if (data.data.list) {
                            for (var i = 0; i < data.data.list.length; i++) {
                                if ('${sessionScope.locale}'.indexOf('en') !== -1) {
                                    xAxis.push(data.data.list[i].enName || '');
                                    fullName.push(data.data.list[i].fullEnName || '');
                                    hospitalJson[i].name = hospitalJson[i].enName;
                                } else {
                                    xAxis.push(data.data.list[i].name || '');
                                    fullName.push(data.data.list[i].fullName || '');
                                }
                                ids.push(data.data.list[i].id || '');
                                curHospitalCounts.push(data.data.list[i].curHospitalCounts || 0);
                                curDevicePrice.push(parseFloat((data.data.list[i].curDevicePrice / CONST) || 0).toFixed(2));
                                curAgeLimitMeasure.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                                curFaultCounts.push(data.data.list[i].curFaultCounts || 0);
                                curEstimateCostWanyuan.push(parseFloat(data.data.list[i].curEstimateCostWanyuan || 0).toFixed(2));
                                curUpkeepRate.push(parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2));
                                curInspectionRate.push(parseFloat(data.data.list[i].curInspectionRate || 0).toFixed(2));
                                curEstimateLabourCost.push(parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2));
                                curEstimateTotalCost.push(parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2));
                                curBigRepairCounts.push(data.data.list[i].curBigRepairCounts || 0);
                                curMiddleRepairCounts.push(data.data.list[i].curMiddleRepairCounts || 0);
                                curSmallRepairCounts.push(data.data.list[i].curSmallRepairCounts || 0);
                                curToRepairCounts.push(data.data.list[i].curToRepairCounts || 0);
                                curIntactRatio.push(parseFloat(data.data.list[i].curIntactRatio || 0).toFixed(2));
                                curHaltHours.push(parseFloat(data.data.list[i].curHaltHours || 0).toFixed(2));
                                curAvgResponseMin.push(data.data.list[i].curAvgResponseMin || 0);
                                curAvgRepairUsedMin.push(parseFloat((data.data.list[i].curAvgRepairUsedMin || 0) / 60 / 24).toFixed(2));
                            }
                            sort('desc', curDevicePrice, ids, xAxis, curHospitalCounts, curAgeLimitMeasure, curFaultCounts, curEstimateCostWanyuan, curUpkeepRate, curInspectionRate, curEstimateLabourCost, curEstimateTotalCost, curBigRepairCounts, curMiddleRepairCounts, curSmallRepairCounts, curToRepairCounts, fullName, curIntactRatio, curHaltHours, curAvgResponseMin, curAvgRepairUsedMin);
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setUlHospital('desc', 0);
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') === 'hospital')) morehospitals();

                    queryStatus.hospital = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        // 获取图表数据(设备类型)
        function queryTypeTop5Data(tableId) {
            idsType = [];
            xAxisType = [];
            curHospitalCountsType = [];         //医院数量
            curDevicePriceType = [];            //设备金额
            curAgeLimitMeasureType = [];        //年限指数
            curFaultCountsType = [];            //高危故障数
            curEstimateCostWanyuanType = [];    //万元维修费用
            curUpkeepRateType = [];             //保养率
            curInspectionRateType = [];         //巡检率
            curEstimateLabourCostType = [];     //人工费用
            curEstimateTotalCostType = [];     //维修费用
            curBigRepairCountsType = [];        // 大维修数量
            curMiddleRepairCountsType = [];     // 中维修数量
            curSmallRepairCountsType = [];      // 小维修数量
            curToRepairCountsType = [];
            fullNameType = [];
            curIntactRatioType = [];
            curHaltHoursType = [];
            curAvgResponseMinType = [];
            curAvgRepairUsedMinType = [];

            typeJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/model-maintain/model',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintainSize: maintainSize
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        typeJson = data.data.list;
                        if (data.data.list) {
                            for (var i = 0; i < data.data.list.length; i++) {
                                idsType.push(data.data.list[i].id || '');
                                xAxisType.push(data.data.list[i].name || '');
                                curHospitalCountsType.push(data.data.list[i].curHospitalCounts || 0);
                                curDevicePriceType.push(parseFloat((data.data.list[i].curDevicePrice / CONST) || 0).toFixed(2));
                                curAgeLimitMeasureType.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                                curFaultCountsType.push(data.data.list[i].curFaultCounts || 0);
                                curEstimateCostWanyuanType.push(parseFloat(data.data.list[i].curEstimateCostWanyuan || 0).toFixed(2));
                                curUpkeepRateType.push(parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2));
                                curInspectionRateType.push(parseFloat(data.data.list[i].curInspectionRate || 0).toFixed(2));
                                curEstimateLabourCostType.push(parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2));
                                curEstimateTotalCostType.push(parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2));
                                curBigRepairCountsType.push(data.data.list[i].curBigRepairCounts || 0);
                                curMiddleRepairCountsType.push(data.data.list[i].curMiddleRepairCounts || 0);
                                curSmallRepairCountsType.push(data.data.list[i].curSmallRepairCounts || 0);
                                curToRepairCountsType.push(data.data.list[i].curToRepairCounts || 0);
                                fullNameType.push(data.data.list[i].fullName || '');
                                curIntactRatioType.push(parseFloat(data.data.list[i].curIntactRatio || 0).toFixed(2));
                                curHaltHoursType.push(parseFloat(data.data.list[i].curHaltHours || 0).toFixed(2));
                                curAvgResponseMinType.push(data.data.list[i].curAvgResponseMin || 0);
                                curAvgRepairUsedMinType.push(parseFloat((data.data.list[i].curAvgRepairUsedMin || 0) / 60 / 24).toFixed(2));
                            }
                            avgEstimateTotalCost = parseFloat(data.data.avgEstimateTotalCost / CONST).toFixed(2);
                            avgAgeLimitMeasure = 1;
                            avgDevicePrice = parseFloat((data.data.avgDevicePrice / CONST) || 0).toFixed(2);
                            avgEstimateCostWanyuan = parseFloat(data.data.avgEstimateCostWanyuan || 0).toFixed(2);
                            sort('desc', curDevicePriceType, idsType, xAxisType, curHospitalCountsType, curAgeLimitMeasureType, curFaultCountsType, curEstimateCostWanyuanType, curUpkeepRateType, curInspectionRateType, curEstimateLabourCostType, curEstimateTotalCostType, curBigRepairCountsType, curMiddleRepairCountsType, curSmallRepairCountsType, curToRepairCountsType, fullNameType, curIntactRatioType, curHaltHoursType, curAvgResponseMinType, curAvgRepairUsedMinType);
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setChatsData(title);
                    setUlType('desc', 0);
                    copySatus = true;
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') === 'type')) moretypes();

                    queryStatus.model = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        /*
    * tag   select的值　0-故障次数  1-设备完好率  2-设备响应时间、维修时间
    * 设置图表数据
    * */
        function setChatsData(tag) {
            title = tag;
            var series = [];
            if (tag == '0') {
                $('.listpercent').html('<fmt:message key="maintainer.table.wxcs(c)"/>');
                $('.listcontent').html('<fmt:message key="performance.table.sbje(wy)"/>');
                $('#top5_maintainer, #top5_device, #top5_year').find('.listcontent').html('<fmt:message key="maintain.table.wxje(wy)"/>');
                sort('desc', curDevicePrice, ids, xAxis, curHospitalCounts, curAgeLimitMeasure, curFaultCounts, curEstimateCostWanyuan, curUpkeepRate, curInspectionRate, curEstimateLabourCost, curEstimateTotalCost, curBigRepairCounts, curMiddleRepairCounts, curSmallRepairCounts, curToRepairCounts, fullName, curIntactRatio, curHaltHours, curAvgResponseMin, curAvgRepairUsedMin);
                sort('desc', curDevicePriceType, idsType, xAxisType, curHospitalCountsType, curAgeLimitMeasureType, curFaultCountsType, curEstimateCostWanyuanType, curUpkeepRateType, curInspectionRateType, curEstimateLabourCostType, curEstimateTotalCostType, curBigRepairCountsType, curMiddleRepairCountsType, curSmallRepairCountsType, curToRepairCountsType, fullNameType, curIntactRatioType, curHaltHoursType, curAvgResponseMinType, curAvgRepairUsedMinType);
                sort('desc', curDevicePriceBrand, idsBrand, xAxisBrand, curHospitalCountsBrand, curAgeLimitMeasureBrand, curFaultCountsBrand, curEstimateCostWanyuanBrand, curUpkeepRateBrand, curInspectionRateBrand, curEstimateLabourCostBrand, curEstimateTotalCostBrand, curBigRepairCountsBrand, curMiddleRepairCountsBrand, curSmallRepairCountsBrand, curToRepairCountsBrand, fullNameBrand, curIntactRatioBrand, curHaltHoursBrand, curAvgResponseMinBrand, curAvgRepairUsedMinBrand);
                sort('desc', curEstimateTotalCostMaintainer, curDevicePriceMaintainer, idsMaintainer, xAxisMaintainer, curHospitalCountsMaintainer, curAgeLimitMeasureMaintainer, curFaultCountsMaintainer, curEstimateCostWanyuanMaintainer, curUpkeepRateMaintainer, curInspectionRateMaintainer, curEstimateLabourCostMaintainer, curBigRepairCountsMaintainer, curMiddleRepairCountsMaintainer, curSmallRepairCountsMaintainer, curToRepairCountsMaintainer, fullNameMaintainer, curIntactRatioMaintainer, curHaltHoursMaintainer, curAvgResponseMinMaintainer, curAvgRepairUsedMinMaintainer);
                sort('desc', curEstimateTotalCostDevice, idsDevice, xAxisDevice, modalNameDevice, departmentDevice, departmentDevice, snDevice, assetsNoDevice, curEstimateLabourCostDevice, curEstimatePartCostDevice, curToRepairCountsDevice, curRepairedCountsDevice, curFaultCountsDevice, curResponseMinDevice, curRepairUsedMinDevice, curIntactRatioDevice, curUpkeepRateDevice, ageLimitMeasureDevice, curAvgResponseMinDevice, curAvgRepairUsedMinDevice, fullNameDevice, curEstimateCostWanyuanDevice);
                $('.quadrantContainner').show();
                $('.quadrant').removeClass('active');
                optionAgelimit.xAxis.name = '<fmt:message key="performance.table.sbje(wy)"/>';
                optionAgelimit.yAxis[0].name = '<fmt:message key="maintain.table.wxje(wy)"/>';
                optionAgelimit.series[0].markLine.data[0].name = '<fmt:message key="charts.avg.sbjepjz(wy)"/>';
                optionAgelimit.series[0].markLine.data[0].xAxis = avgDevicePrice;
                optionAgelimit.series[0].markLine.data[1].name = '<fmt:message key="charts.avg.wxjepjz(wy)"/>';
                optionAgelimit.series[0].markLine.data[1].yAxis = avgEstimateTotalCost;
                for (var i = 0; i < xAxisType.length; i++) {
                    series.push([curDevicePriceType[i], curEstimateTotalCostType[i], 50, xAxisType[i]]);
                }
                optionAgelimit.series[0].data = series;
                chart.clear();
                chart.setOption(optionAgelimit);
            } else if (tag == '1') {
                $('.listpercent').html('<fmt:message key="maintain.table.nxzs"/>');
                $('.listcontent').html('<fmt:message key="charts.axis.wywxje"/>');
                $('#top5_year').find('.listpercent').html('<fmt:message key="maintainer.table.wxcs(c)"/>');
                $('#top5_year').find('.listcontent').html('<fmt:message key="maintain.table.wxje(wy)"/>');
                sort('desc', curEstimateCostWanyuan, curDevicePrice, ids, xAxis, curHospitalCounts, curAgeLimitMeasure, curFaultCounts, curUpkeepRate, curInspectionRate, curEstimateLabourCost, curEstimateTotalCost, curBigRepairCounts, curMiddleRepairCounts, curSmallRepairCounts, curToRepairCounts, fullName, curIntactRatio, curHaltHours, curAvgResponseMin, curAvgRepairUsedMin);
                sort('desc', curEstimateCostWanyuanType, curDevicePriceType, idsType, xAxisType, curHospitalCountsType, curAgeLimitMeasureType, curFaultCountsType, curUpkeepRateType, curInspectionRateType, curEstimateLabourCostType, curEstimateTotalCostType, curBigRepairCountsType, curMiddleRepairCountsType, curSmallRepairCountsType, curToRepairCountsType, fullNameType, curIntactRatioType, curHaltHoursType, curAvgResponseMinType, curAvgRepairUsedMinType);
                sort('desc', curEstimateCostWanyuanBrand, curDevicePriceBrand, idsBrand, xAxisBrand, curHospitalCountsBrand, curAgeLimitMeasureBrand, curFaultCountsBrand, curUpkeepRateBrand, curInspectionRateBrand, curEstimateLabourCostBrand, curEstimateTotalCostBrand, curBigRepairCountsBrand, curMiddleRepairCountsBrand, curSmallRepairCountsBrand, curToRepairCountsBrand, fullNameBrand, curIntactRatioBrand, curHaltHoursBrand, curAvgResponseMinBrand, curAvgRepairUsedMinBrand);
                sort('desc', curEstimateCostWanyuanMaintainer, curDevicePriceMaintainer, idsMaintainer, xAxisMaintainer, curHospitalCountsMaintainer, curAgeLimitMeasureMaintainer, curFaultCountsMaintainer, curUpkeepRateMaintainer, curInspectionRateMaintainer, curEstimateLabourCostMaintainer, curEstimateTotalCostMaintainer, curBigRepairCountsMaintainer, curMiddleRepairCountsMaintainer, curSmallRepairCountsMaintainer, curToRepairCountsMaintainer, fullNameMaintainer, curIntactRatioMaintainer, curHaltHoursMaintainer, curAvgResponseMinMaintainer, curAvgRepairUsedMinMaintainer);
                sort('desc', curEstimateCostWanyuanDevice, curEstimateTotalCostDevice, idsDevice, xAxisDevice, modalNameDevice, departmentDevice, departmentDevice, snDevice, assetsNoDevice, curEstimateLabourCostDevice, curEstimatePartCostDevice, curToRepairCountsDevice, curRepairedCountsDevice, curFaultCountsDevice, curResponseMinDevice, curRepairUsedMinDevice, curIntactRatioDevice, curUpkeepRateDevice, ageLimitMeasureDevice, curAvgResponseMinDevice, curAvgRepairUsedMinDevice, fullNameDevice);
                $('.quadrantContainner').show();
                $('.quadrant').removeClass('active');
                optionAgelimit.xAxis.name = '<fmt:message key="charts.axis.wywxje"/>';
                optionAgelimit.yAxis[0].name = '<fmt:message key="maintain.table.nxzs"/>';
                optionAgelimit.series[0].markLine.data[0].name = '<fmt:message key="charts.avg.wywxjepjz"/>';
                optionAgelimit.series[0].markLine.data[0].xAxis = avgEstimateCostWanyuan;
                optionAgelimit.series[0].markLine.data[1].name = '<fmt:message key="charts.avg.nxzsbzx"/>';
                optionAgelimit.series[0].markLine.data[1].yAxis = avgAgeLimitMeasure;
                for (var i = 0; i < xAxisType.length; i++) {
                    series.push([curEstimateCostWanyuanType[i], curAgeLimitMeasureType[i], 50, xAxisType[i]]);
                }
                optionAgelimit.series[0].data = series;
                chart.clear();
                chart.setOption(optionAgelimit);
            } else if (tag == '2') {
                $('.listpercent').html('<fmt:message key="maintain.table.xjl(%)"/>');
                $('.listcontent').html('<fmt:message key="maintain.table.byl(%)"/>');
                $('#top5_year').find('.listpercent').html('<fmt:message key="maintainer.table.wxcs(c)"/>');
                $('#top5_year').find('.listcontent').html('<fmt:message key="maintain.table.wxje(wy)"/>');
                sort('desc', curUpkeepRate, curDevicePrice, ids, xAxis, curHospitalCounts, curAgeLimitMeasure, curFaultCounts, curEstimateCostWanyuan, curInspectionRate, curEstimateLabourCost, curEstimateTotalCost, curBigRepairCounts, curMiddleRepairCounts, curSmallRepairCounts, curToRepairCounts, fullName, curIntactRatio, curHaltHours, curAvgResponseMin, curAvgRepairUsedMin);
                sort('desc', curUpkeepRateType, curDevicePriceType, idsType, xAxisType, curHospitalCountsType, curAgeLimitMeasureType, curFaultCountsType, curEstimateCostWanyuanType, curInspectionRateType, curEstimateLabourCostType, curEstimateTotalCostType, curBigRepairCountsType, curMiddleRepairCountsType, curSmallRepairCountsType, curToRepairCountsType, fullNameType, curIntactRatioType, curHaltHoursType, curAvgResponseMinType, curAvgRepairUsedMinType);
                sort('desc', curUpkeepRateBrand, curDevicePriceBrand, idsBrand, xAxisBrand, curHospitalCountsBrand, curAgeLimitMeasureBrand, curFaultCountsBrand, curEstimateCostWanyuanBrand, curInspectionRateBrand, curEstimateLabourCostBrand, curEstimateTotalCostBrand, curBigRepairCountsBrand, curMiddleRepairCountsBrand, curSmallRepairCountsBrand, curToRepairCountsBrand, fullNameBrand, curIntactRatioBrand, curHaltHoursBrand, curAvgResponseMinBrand, curAvgRepairUsedMinBrand);
                sort('desc', curUpkeepRateMaintainer, curDevicePriceMaintainer, idsMaintainer, xAxisMaintainer, curHospitalCountsMaintainer, curAgeLimitMeasureMaintainer, curFaultCountsMaintainer, curEstimateCostWanyuanMaintainer, curInspectionRateMaintainer, curEstimateLabourCostMaintainer, curEstimateTotalCostMaintainer, curBigRepairCountsMaintainer, curMiddleRepairCountsMaintainer, curSmallRepairCountsMaintainer, curToRepairCountsMaintainer, fullNameMaintainer, curIntactRatioMaintainer, curHaltHoursMaintainer, curAvgResponseMinMaintainer, curAvgRepairUsedMinMaintainer);
                sort('desc', curUpkeepRateDevice, curEstimateTotalCostDevice, idsDevice, xAxisDevice, modalNameDevice, departmentDevice, departmentDevice, snDevice, assetsNoDevice, curEstimateLabourCostDevice, curEstimatePartCostDevice, curToRepairCountsDevice, curRepairedCountsDevice, curFaultCountsDevice, curResponseMinDevice, curRepairUsedMinDevice, curIntactRatioDevice, ageLimitMeasureDevice, curAvgResponseMinDevice, curAvgRepairUsedMinDevice, fullNameDevice, curEstimateCostWanyuanDevice);
                $('.quadrantContainner').hide();
                optionB.xAxis.data = xAxisType;
                optionB.series[0].data = curBigRepairCountsType;
                optionB.series[1].data = curMiddleRepairCountsType;
                optionB.series[2].data = curSmallRepairCountsType;
                optionB.series[3].data = curFaultCountsType;
                optionB.series[4].data = curInspectionRateType;
                optionB.series[5].data = curUpkeepRateType;
                //图表滚动条
                if (xAxisType.length > 12) {
                    optionB.dataZoom[0].end = 1200 / xAxisType.length;
                } else {
                    optionB.dataZoom[0].end = 100;
                }
                chart.clear();
                chart.setOption(optionB);
            } else if (tag == '3') {
                $('.listpercent').html('<fmt:message key="maintainer.table.pjxysj(fz)"/>');
                $('.listcontent').html('<fmt:message key="maintainer.table.pjwxsj(t)"/>');
                $('#top5_year').find('.listpercent').html('<fmt:message key="maintainer.table.wxcs(c)"/>');
                $('#top5_year').find('.listcontent').html('<fmt:message key="maintain.table.wxje(wy)"/>');
                sort('desc', curAvgRepairUsedMin, curDevicePrice, ids, xAxis, curHospitalCounts, curAgeLimitMeasure, curFaultCounts, curEstimateCostWanyuan, curUpkeepRate, curInspectionRate, curEstimateLabourCost, curEstimateTotalCost, curBigRepairCounts, curMiddleRepairCounts, curSmallRepairCounts, curToRepairCounts, fullName, curIntactRatio, curHaltHours, curAvgResponseMin);
                sort('desc', curAvgRepairUsedMinType, curDevicePriceType, idsType, xAxisType, curHospitalCountsType, curAgeLimitMeasureType, curFaultCountsType, curEstimateCostWanyuanType, curUpkeepRateType, curInspectionRateType, curEstimateLabourCostType, curEstimateTotalCostType, curBigRepairCountsType, curMiddleRepairCountsType, curSmallRepairCountsType, curToRepairCountsType, fullNameType, curIntactRatioType, curHaltHoursType, curAvgResponseMinType);
                sort('desc', curAvgRepairUsedMinBrand, curDevicePriceBrand, idsBrand, xAxisBrand, curHospitalCountsBrand, curAgeLimitMeasureBrand, curFaultCountsBrand, curEstimateCostWanyuanBrand, curUpkeepRateBrand, curInspectionRateBrand, curEstimateLabourCostBrand, curEstimateTotalCostBrand, curBigRepairCountsBrand, curMiddleRepairCountsBrand, curSmallRepairCountsBrand, curToRepairCountsBrand, fullNameBrand, curIntactRatioBrand, curHaltHoursBrand, curAvgResponseMinBrand);
                sort('desc', curAvgRepairUsedMinMaintainer, curDevicePriceMaintainer, idsMaintainer, xAxisMaintainer, curHospitalCountsMaintainer, curAgeLimitMeasureMaintainer, curFaultCountsMaintainer, curEstimateCostWanyuanMaintainer, curUpkeepRateMaintainer, curInspectionRateMaintainer, curEstimateLabourCostMaintainer, curEstimateTotalCostMaintainer, curBigRepairCountsMaintainer, curMiddleRepairCountsMaintainer, curSmallRepairCountsMaintainer, curToRepairCountsMaintainer, fullNameMaintainer, curIntactRatioMaintainer, curHaltHoursMaintainer, curAvgResponseMinMaintainer);
                sort('desc', curAvgRepairUsedMinDevice, curEstimateTotalCostDevice, idsDevice, xAxisDevice, modalNameDevice, departmentDevice, departmentDevice, snDevice, assetsNoDevice, curEstimateLabourCostDevice, curEstimatePartCostDevice, curToRepairCountsDevice, curRepairedCountsDevice, curFaultCountsDevice, curResponseMinDevice, curRepairUsedMinDevice, curIntactRatioDevice, curUpkeepRateDevice, ageLimitMeasureDevice, curAvgResponseMinDevice, fullNameDevice, curEstimateCostWanyuanDevice);
                $('.quadrantContainner').hide();
                optionB2.xAxis.data = xAxisType;
                optionB2.series[0].data = curAvgResponseMinType;
                optionB2.series[1].data = typeJson.getArrayByKey('curAvgFaultMin');
                optionB2.series[2].data = typeJson.getArrayByKey('curAvgHaltMin');
                optionB2.series[3].data = curAvgRepairUsedMinType.calc('/', 3600, 2);//图表滚动条
                if (xAxisType.length > 12) {
                    optionB2.dataZoom[0].end = 1200 / xAxisType.length;
                } else {
                    optionB2.dataZoom[0].end = 100;
                }
                chart.clear();
                chart.setOption(optionB2);
            }

            $('.option_overyear').removeClass('active');
        }

        // 获取图表数据(设备厂家)
        function queryBrandTop5Data(tableId) {
            idsBrand = [];
            xAxisBrand = [];
            curHospitalCountsBrand = [];         //医院数量
            curDevicePriceBrand = [];            //设备金额
            curAgeLimitMeasureBrand = [];        //年限指数
            curFaultCountsBrand = [];            //高危故障数
            curEstimateCostWanyuanBrand = [];    //万元维修费用
            curUpkeepRateBrand = [];             //保养率
            curInspectionRateBrand = [];         //巡检率
            curEstimateLabourCostBrand = [];     //人工费用
            curEstimateTotalCostBrand = [];     //维修费用
            curBigRepairCountsBrand = [];        // 大维修数量
            curMiddleRepairCountsBrand = [];     // 中维修数量
            curSmallRepairCountsBrand = [];      // 小维修数量
            curToRepairCountsBrand = [];
            fullNameBrand = [];
            curIntactRatioBrand = [];
            curHaltHoursBrand = [];
            curAvgResponseMinBrand = [];
            curAvgRepairUsedMinBrand = [];

            brandJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/model-maintain/brand',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    modelName: modelName,
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintainSize: maintainSize
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        brandJson = data.data.list;
                        if (data.data.list) {
                            for (var i = 0; i < data.data.list.length; i++) {
                                idsBrand.push(data.data.list[i].id || '');
                                xAxisBrand.push(data.data.list[i].name || '');
                                curHospitalCountsBrand.push(data.data.list[i].curHospitalCounts || 0);
                                curDevicePriceBrand.push(parseFloat((data.data.list[i].curDevicePrice / CONST) || 0).toFixed(2));
                                curAgeLimitMeasureBrand.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                                curFaultCountsBrand.push(data.data.list[i].curFaultCounts || 0);
                                curEstimateCostWanyuanBrand.push(parseFloat(data.data.list[i].curEstimateCostWanyuan || 0).toFixed(2));
                                curUpkeepRateBrand.push(parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2));
                                curInspectionRateBrand.push(parseFloat(data.data.list[i].curInspectionRate || 0).toFixed(2));
                                curEstimateLabourCostBrand.push(parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2));
                                curEstimateTotalCostBrand.push(parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2));
                                curBigRepairCountsBrand.push(data.data.list[i].curBigRepairCounts || 0);
                                curMiddleRepairCountsBrand.push(data.data.list[i].curMiddleRepairCounts || 0);
                                curSmallRepairCountsBrand.push(data.data.list[i].curSmallRepairCounts || 0);
                                curToRepairCountsBrand.push(data.data.list[i].curToRepairCounts || 0);
                                fullNameBrand.push(data.data.list[i].fullName || '');
                                curIntactRatioBrand.push(parseFloat(data.data.list[i].curIntactRatio || 0).toFixed(2));
                                curHaltHoursBrand.push(parseFloat(data.data.list[i].curHaltHours || 0).toFixed(2));
                                curAvgResponseMinBrand.push(data.data.list[i].curAvgResponseMin || 0);
                                curAvgRepairUsedMinBrand.push(parseFloat((data.data.list[i].curAvgRepairUsedMin || 0) / 60 / 24).toFixed(2));
                            }
                            sort('desc', curDevicePriceBrand, idsBrand, xAxisBrand, curHospitalCountsBrand, curAgeLimitMeasureBrand, curFaultCountsBrand, curEstimateCostWanyuanBrand, curUpkeepRateBrand, curInspectionRateBrand, curEstimateLabourCostBrand, curEstimateTotalCostBrand, curBigRepairCountsBrand, curMiddleRepairCountsBrand, curSmallRepairCountsBrand, curToRepairCountsBrand, fullNameBrand, curIntactRatioBrand, curHaltHoursBrand, curAvgResponseMinBrand, curAvgRepairUsedMinBrand);
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setUlBrand('desc', 0);
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') === 'brand')) morebrands();

                    queryStatus.brand = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        // 获取图表数据(维修商)
        function queryMaintainerTop5Data(tableId) {
            idsMaintainer = [];
            xAxisMaintainer = [];
            curHospitalCountsMaintainer = [];         //医院数量
            curDevicePriceMaintainer = [];            //设备金额
            curAgeLimitMeasureMaintainer = [];        //年限指数
            curFaultCountsMaintainer = [];            //高危故障数
            curEstimateCostWanyuanMaintainer = [];    //万元维修费用
            curUpkeepRateMaintainer = [];             //保养率
            curInspectionRateMaintainer = [];         //巡检率
            curEstimateLabourCostMaintainer = [];     //人工费用
            curEstimateTotalCostMaintainer = [];     //维修费用
            curBigRepairCountsMaintainer = [];        // 大维修数量
            curMiddleRepairCountsMaintainer = [];     // 中维修数量
            curSmallRepairCountsMaintainer = [];      // 小维修数量
            curToRepairCountsMaintainer = [];
            curIntactRatioMaintainer = [];
            curHaltHoursMaintainer = [];
            curAvgResponseMinMaintainer = [];
            curAvgRepairUsedMinMaintainer = [];
            fullNameMaintainer = [];

            maintainerJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/model-maintain/maintainer',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    modelName: modelName,
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintainSize: maintainSize
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        maintainerJson = data.data.list;
                        if (data.data.list) {
                            for (var i = 0; i < data.data.list.length; i++) {
                                idsMaintainer.push(data.data.list[i].id || '');
                                xAxisMaintainer.push(data.data.list[i].name || '');
                                curHospitalCountsMaintainer.push(data.data.list[i].curHospitalCounts || 0);
                                curDevicePriceMaintainer.push(parseFloat((data.data.list[i].curDevicePrice / CONST) || 0).toFixed(2));
                                curAgeLimitMeasureMaintainer.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                                curFaultCountsMaintainer.push(data.data.list[i].curFaultCounts || 0);
                                curEstimateCostWanyuanMaintainer.push(parseFloat(data.data.list[i].curEstimateCostWanyuan || 0).toFixed(2));
                                curUpkeepRateMaintainer.push(parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2));
                                curInspectionRateMaintainer.push(parseFloat(data.data.list[i].curInspectionRate || 0).toFixed(2));
                                curEstimateLabourCostMaintainer.push(parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2));
                                curEstimateTotalCostMaintainer.push(parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2));
                                curBigRepairCountsMaintainer.push(data.data.list[i].curBigRepairCounts || 0);
                                curMiddleRepairCountsMaintainer.push(data.data.list[i].curMiddleRepairCounts || 0);
                                curSmallRepairCountsMaintainer.push(data.data.list[i].curSmallRepairCounts || 0);
                                curToRepairCountsMaintainer.push(data.data.list[i].curTotalRepairCounts || 0);
                                curIntactRatioMaintainer.push(parseFloat(data.data.list[i].curIntactRatio || 0).toFixed(2));
                                curHaltHoursMaintainer.push(parseFloat(data.data.list[i].curHaltHours || 0).toFixed(2));
                                curAvgResponseMinMaintainer.push(data.data.list[i].curAvgResponseMin || 0);
                                curAvgRepairUsedMinMaintainer.push(parseFloat((data.data.list[i].curAvgRepairUsedMin || 0) / 60 / 24).toFixed(2));
                                fullNameMaintainer.push(data.data.list[i].fullName || '');
                            }
                            sort('desc', curEstimateTotalCostMaintainer, curDevicePriceMaintainer, idsMaintainer, xAxisMaintainer, curHospitalCountsMaintainer, curAgeLimitMeasureMaintainer, curFaultCountsMaintainer, curEstimateCostWanyuanMaintainer, curUpkeepRateMaintainer, curInspectionRateMaintainer, curEstimateLabourCostMaintainer, curBigRepairCountsMaintainer, curMiddleRepairCountsMaintainer, curSmallRepairCountsMaintainer, curToRepairCountsMaintainer, curIntactRatioMaintainer, curHaltHoursMaintainer, curAvgResponseMinMaintainer, curAvgRepairUsedMinMaintainer, fullNameMaintainer);
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setUlMaintainer('desc', 0);
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') === 'maintainer')) moremaintainers();

                    queryStatus.maintainer = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        // 获取图表数据(维修商)
        function queryDeviceTop5Data(tableId) {
            idsDevice = [];
            xAxisDevice = [];
            modalNameDevice = [];
            departmentDevice = [];
            manufacturerDevice = [];
            snDevice = [];
            assetsNoDevice = [];
            curEstimateLabourCostDevice = [];
            curEstimatePartCostDevice = [];
            curEstimateTotalCostDevice = [];
            curToRepairCountsDevice = [];
            curRepairedCountsDevice = [];
            curFaultCountsDevice = [];
            curResponseMinDevice = [];
            curRepairUsedMinDevice = [];
            curIntactRatioDevice = [];
            curUpkeepRateDevice = [];
            ageLimitMeasureDevice = [];
            curAvgResponseMinDevice = [];
            curAvgRepairUsedMinDevice = [];
            curEstimateCostWanyuanDevice = [];
            fullNameDevice = [];

            deviceJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/model-maintain/assets',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintainSize: maintainSize
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        deviceJson = (data.data.list || []).sortByKey('curEstimateTotalCost').calTotal();
                        if (data.data.list) {
                            for (var i = 0; i < data.data.list.length; i++) {
                                idsDevice.push(data.data.list[i].id || '');
                                xAxisDevice.push(data.data.list[i].name || '');
                                modalNameDevice.push(data.data.list[i].modalName || '');
                                departmentDevice.push(data.data.list[i].department || '');
                                manufacturerDevice.push(data.data.list[i].manufacturer || '');
                                snDevice.push(data.data.list[i].sn || '');
                                assetsNoDevice.push(data.data.list[i].assetsNo || '');
                                curEstimateLabourCostDevice.push(parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2));
                                curEstimatePartCostDevice.push(parseFloat((data.data.list[i].curEstimatePartCost / CONST) || 0).toFixed(2));
                                curEstimateTotalCostDevice.push(parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2));
                                curToRepairCountsDevice.push((data.data.list[i].curToRepairCounts || 0));
                                curRepairedCountsDevice.push((data.data.list[i].curRepairedCounts || 0));
                                curFaultCountsDevice.push((data.data.list[i].curFaultCounts || 0));
                                curResponseMinDevice.push(parseFloat(data.data.list[i].curResponseMin || 0).toFixed(2));
                                curRepairUsedMinDevice.push(parseFloat(data.data.list[i].curRepairUsedMin || 0).toFixed(2));
                                curIntactRatioDevice.push(parseFloat(data.data.list[i].curIntactRatio || 0).toFixed(2));
                                curUpkeepRateDevice.push(parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2));
                                ageLimitMeasureDevice.push(parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2));
                                curAvgResponseMinDevice.push(data.data.list[i].curResponseMin || 0);
                                curAvgRepairUsedMinDevice.push(parseFloat((data.data.list[i].curRepairUsedMin || 0) / 60 / 24).toFixed(2));
                                curEstimateCostWanyuanDevice.push(parseFloat(data.data.list[i].curEstimateCostWanyuan || 0).toFixed(2));
                            }
                            fullNameDevice = $.extend({}, xAxisDevice);
                            sort('desc', curEstimateTotalCostDevice, idsDevice, xAxisDevice, modalNameDevice, departmentDevice, manufacturerDevice, snDevice, assetsNoDevice, curEstimateLabourCostDevice, curEstimatePartCostDevice, curToRepairCountsDevice, curRepairedCountsDevice, curFaultCountsDevice, curResponseMinDevice, curRepairUsedMinDevice, curIntactRatioDevice, curUpkeepRateDevice, ageLimitMeasureDevice, curAvgResponseMinDevice, curAvgRepairUsedMinDevice, fullNameDevice, curEstimateCostWanyuanDevice);
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setUlDevice('desc', 0);
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') === 'device')) moredevices();

                    queryStatus.assets = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        $('#morehospitals').click(morehospitals);

        function morehospitals() {
            loading(function () {
                var modal = $('#modal').attr('modal', 'hospital');
                var sb = new StringBuffer();
                var data = hospitalJson;
                var tag = $('#tag').val();
                var table = $("#tblSort").html('<tbody></tbody>');
                var tbody = table.find('tbody');
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.yyks"/></th>");

                //表格内容
                sb.append("<th class='text-right'><fmt:message key="maintainer.table.wxcs(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxcstb(%)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.dwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.zwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.xwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxsbsl(t)"/></th>"
                    + (function () {
                        var str = '';
                        if (tag == '0') {
                            str += "<th class='text-right'><fmt:message key="share.assets.sbje(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.rgfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.bjfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.zwxfy(wy)"/></th>";
                        } else if (tag == '1') {
                            str += "<th class='text-right'><fmt:message key="charts.axis.wywxje"/></th>";
                            str += "<th class='text-right'><fmt:message key="share.sift.nxzs"/></th>";
                        } else if (tag == '2') {
                            str += "<th class='text-right'><fmt:message key="maintian.assets.whl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.byl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintain.table.xjl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.ycxfl(%)"/></th>";
                        } else if (tag == '3') {
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.djcs(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjdjsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.blsj(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.zgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.record.bjghcs"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.pjwxsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjxysj(fz)"/></th>";
                        }
                        return str;
                    })());
                table.prepend(sb.toString());

                groupLoading(data.length, function (min, max) {
                    var str = '';
                    for (var i = min; i < max; i++) {
                        str += "<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal spanTitle' onclick='query(\"hospital\",\"" + data[i].id + "\")'>" + (data[i].name || '') + "</td>"
                            + "<td class='total-1 text-right" + (data[i].curToRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{departmentId:[" + data[i].id + "]}'," + data[i].curToRepairCounts + ")\">" + (data[i].curToRepairCounts || 0) + "</td>"
                            + "<td class='avg-2 text-right'>" + parseFloat(data[i].toRepairCountsYoy || 0).toFixed(2) + "</td>"
                            + "<td class='total-3 text-right" + (data[i].curBigRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:1,departmentId:[" + data[i].id + "]}'," + data[i].curBigRepairCounts + ")\">" + (data[i].curBigRepairCounts || 0) + "</td>"
                            + "<td class='total-4 text-right" + (data[i].curMiddleRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:2,departmentId:[" + data[i].id + "]}'," + data[i].curMiddleRepairCounts + ")\">" + (data[i].curMiddleRepairCounts || 0) + "</td>"
                            + "<td class='total-5 text-right" + (data[i].curSmallRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:3,departmentId:[" + data[i].id + "]}'," + data[i].curSmallRepairCounts + ")\">" + (data[i].curSmallRepairCounts || 0) + "</td>"
                            + "<td class='total-6 text-right" + (data[i].curRepairedDeviceCounts ? ' spanTitle' : '') + "' onclick=\"query('repair','{departmentId:[" + data[i].id + "]}'," + data[i].curRepairedDeviceCounts + ")\">" + (data[i].curRepairedDeviceCounts || 0) + "</td>"
                            + (function () {
                                var str = '';
                                if (tag == '0') {
                                    str += "<td class='total-7 text-right'>" + parseFloat(data[i].curDevicePrice / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-8 text-right'>" + parseFloat(data[i].curEstimateLabourCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-9 text-right'>" + parseFloat(data[i].curEstimatePartCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-0 text-right'>" + parseFloat(data[i].curEstimateTotalCost / CONST || 0).toFixed(2) + "</td>";
                                } else if (tag == '1') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curEstimateCostWanyuan || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curAgeLimitMeasure || 0).toFixed(2) + "</td>";
                                } else if (tag == '2') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curIntactRatio || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curUpkeepRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-9 text-right'>" + parseFloat(data[i].curInspectionRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + parseFloat(data[i].lastOnceRepairRate || 0).toFixed(2) + "</td>";
                                } else if (tag == '3') {
                                    str += "<td class='total-7 text-right" + (data[i].curHaltCounts ? ' spanTitle' : '') + "' onclick=\"query('halt','{departmentId:[" + data[i].id + "]}'," + data[i].curHaltCounts + ")\">" + (data[i].curHaltCounts || 0) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + (data[i].curAvgHaltMin || 0) + "</td>";
                                    str += "<td class='total-9 text-right'>" + (data[i].curFaultCounts || 0) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + (data[i].curAvgFaultMin || 0) + "</td>";
                                    str += "<td class='total-11 text-right'>" + (data[i].curTotalFaultMin || 0) + "</td>";
                                    str += "<td class='total-22 text-right'>" + (data[i].curPartChangeCounts || 0) + "</td>";
                                    str += "<td class='avg-33 text-right'>" + (data[i].curAvgRepairUsedMin || 0) + "</td>";
                                    str += "<td class='avg-44 text-right'>" + (data[i].curAvgResponseMin || 0) + "</td>";
                                }
                                return str;
                            })()
                            + "</tr>";
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData('tblSort', true);
                });
                modal.iziModal('setTitle', '<fmt:message key="charts.title.yyksfb"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }

        $('#moredetail, #moretypes').click(moretypes);

        function moretypes(param) {
            loading(function () {
                param = $.extend({}, {
                    id: '',
                    dataJson: typeJson,
                    modal: 'modal',
                    table: 'tblSort'
                }, param);
                var tag = $('#tag').val();
                var data = $.extend([], param.dataJson);
                var modal = $('#' + param.modal);
                var table = $('#' + param.table);
                modal.attr('modal', 'type');
                var sb = new StringBuffer();
                table.html('<tbody></tbody>');
                var tbody = table.find('tbody');
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbxh"/></th>");

                //表格内容
                sb.append("<th class='text-right'><fmt:message key="maintainer.table.wxcs(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxcstb(%)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.dwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.zwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.xwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxcstb(%)"/></th>"
                    + (function () {
                        var str = '';
                        if (tag == '0') {
                            str += "<th class='text-right'><fmt:message key="share.assets.sbje(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.rgfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.bjfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.zwxfy(wy)"/></th>";
                        } else if (tag == '1') {
                            str += "<th class='text-right'><fmt:message key="charts.axis.wywxje"/></th>";
                            str += "<th class='text-right'><fmt:message key="share.sift.nxzs"/></th>";
                        } else if (tag == '2') {
                            str += "<th class='text-right'><fmt:message key="maintian.assets.whl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.byl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintain.table.xjl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.ycxfl(%)"/></th>";
                        } else if (tag == '3') {
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.djcs(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjdjsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.blsj(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.zgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.record.bjghcs"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.pjwxsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjxysj(fz)"/></th>";
                        }
                        return str;
                    })());
                table.prepend(sb.toString());

                groupLoading(data.length, function (min, max) {
                    var str = '';
                    for (var i = min; i < max; i++) {
                        str += "<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal spanTitle' onclick='query(\"type\",\"" + data[i].id + "\")'>" + (data[i].name || '') + "</td>"
                            + "<td class='total-1' text-right" + (data[i].curToRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "modelName:[" + data[i].id + "]}'," + data[i].curToRepairCounts + ")\">" + (data[i].curToRepairCounts || 0) + "</td>"
                            + "<td class='avg-2 text-right'>" + parseFloat(data[i].toRepairCountsYoy || 0).toFixed(2) + "</td>"
                            + "<td class='total-3 text-right" + (data[i].curBigRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintainSize:1,modelName:[" + data[i].id + "]}'," + data[i].curBigRepairCounts + ")\">" + (data[i].curBigRepairCounts || 0) + "</td>"
                            + "<td class='total-4 text-right" + (data[i].curMiddleRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintainSize:2,modelName:[" + data[i].id + "]}'," + data[i].curMiddleRepairCounts + ")\">" + (data[i].curMiddleRepairCounts || 0) + "</td>"
                            + "<td class='total-5 text-right" + (data[i].curSmallRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintainSize:3,modelName:[" + data[i].id + "]}'," + data[i].curSmallRepairCounts + ")\">" + (data[i].curSmallRepairCounts || 0) + "</td>"
                            + "<td class='total-6 text-right" + (data[i].curRepairedDeviceCounts ? ' spanTitle' : '') + "' onclick=\"query('repair','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "modelName:[" + data[i].id + "]}'," + data[i].curRepairedDeviceCounts + ")\">" + (data[i].curRepairedDeviceCounts || 0) + "</td>"
                            + (function () {
                                var str = '';
                                if (tag == '0') {
                                    str += "<td class='total-7 text-right'>" + parseFloat(data[i].curDevicePrice / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-8 text-right'>" + parseFloat(data[i].curEstimateLabourCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-9 text-right'>" + parseFloat(data[i].curEstimatePartCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-0 text-right'>" + parseFloat(data[i].curEstimateTotalCost / CONST || 0).toFixed(2) + "</td>";
                                } else if (tag == '1') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curEstimateCostWanyuan || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curAgeLimitMeasure || 0).toFixed(2) + "</td>";
                                } else if (tag == '2') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curIntactRatio || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curUpkeepRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-9 text-right'>" + parseFloat(data[i].curInspectionRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + parseFloat(data[i].lastOnceRepairRate || 0).toFixed(2) + "</td>";
                                } else if (tag == '3') {
                                    str += "<td class='total-7 text-right" + (data[i].curHaltCounts ? ' spanTitle' : '') + "' onclick=\"query('halt','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "modelName:[" + data[i].id + "]}'," + data[i].curHaltCounts + ")\">" + (data[i].curHaltCounts || 0) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + (data[i].curAvgHaltMin || 0) + "</td>";
                                    str += "<td class='total-9 text-right'>" + (data[i].curFaultCounts || 0) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + (data[i].curAvgFaultMin || 0) + "</td>";
                                    str += "<td class='total-11 text-right'>" + (data[i].curTotalFaultMin || 0) + "</td>";
                                    str += "<td class='total-22 text-right'>" + (data[i].curPartChangeCounts || 0) + "</td>";
                                    str += "<td class='avg-33 text-right'>" + (data[i].curAvgRepairUsedMin || 0) + "</td>";
                                    str += "<td class='avg-44 text-right'>" + (data[i].curAvgResponseMin || 0) + "</td>";
                                }
                                return str;
                            })()
                            + "</tr>";
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData('tblSort', true);
                });
                modal.iziModal('setTitle', '<fmt:message key="charts.title.sbxhfb"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }

        maintainerId = '';

        function query(tag, id, detailId) {
            if (detailId) {
                if (tag === 'hospital') {
                    departmentName = [id];
                    modelName = '';
                    brandId = $('.select_brand').val() ? $('.select_brand').val() : '';
                    maintainerId = '';
                    queryRecordData(detailId);
                } else if (tag === 'type') {
                    modelName = id;
                    departmentName = $('.select_hospital').val() ? $('.select_hospital').val() : '';
                    brandId = $('.select_brand').val() ? $('.select_brand').val() : '';
                    maintainerId = '';
                    queryRecordData(detailId);
                } else if (tag === 'brand') {
                    brandId = [id];
                    departmentName = $('.select_hospital').val() ? $('.select_hospital').val() : '';
                    modelName = '';
                    maintainerId = '';
                    queryRecordData(detailId);
                } else if (tag === 'maintainer') {
                    maintainerId = id;
                    departmentName = $('.select_hospital').val() ? $('.select_hospital').val() : '';
                    modelName = '';
                    brandId = $('.select_brand').val() ? $('.select_brand').val() : '';
                    queryRecordData(detailId);
                } else if (tag === 'record') {
                    queryRecordTable($.extend({}, string2json(id)));
                } else if (tag === 'repair') {
                    queryDeviceTable($.extend({}, string2json(id)));
                } else if (tag === 'halt') {
                    queryHaltTable($.extend({}, string2json(id)));
                }
            } else if (tag === 'hospital') {
                location.href = '<%=basePath%>/charts/hospital/type-index/page?typeId=' + GetQueryString('typeId') + '&departmentId=' + id + '&hospitalId=' + hspId;
            } else if (tag === 'type') {
                queryDeviceTable({modelName: id});
            } else if (tag === 'device' && deviceRedirect) {
                window.open('<%=basePath%>/charts/overview/assets/page?deviceId=' + id);
            } else if (tag === 'year') {
                publicAjax('<%=basePath%>/charts/hospital/model-maintain/model', 'post', {
                    hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: id,
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd
                }, function (data) {
                    if (data.ret && data.data && data.data.list) {
                        typeYear = (data.data.list || []).sortByKey('curDevicePrice').calTotal();
                    } else {
                        typeYear = [];
                    }
                    moretypes({
                        id: id,
                        dataJson: typeYear,
                        modal: 'typeModal',
                        table: 'typeTable'
                    });
                    $('#modal').iziModal('open');
                });
            } else if (tag !== 'repair' && tag !== 'record' && tag !== 'halt'){
                location.href = '<%=basePath%>/charts/hospital/type-' + tag + '/page?typeId=' + GetQueryString('typeId') + '&' + tag + 'Id=' + id + '&hospitalId=' + hspId;
            }
        }

        // 通过设备型号查找设备(设备类型)
        function queryDeviceData(detailId) {
            if ($(".detail-tr-" + detailId).hasClass("hide")) {
                $(".detail-tr-" + detailId).removeClass("hide");
                $("#detail-" + detailId).removeClass("fa-plus");
                $("#detail-" + detailId).addClass("fa-minus");
                $.ajax({
                    type: "POST",
                    url: '<%=basePath%>/charts/hospital/model-maintain/device',
                    data: {
                      hospitalId: hspId,
                        riskId: riskId ? JSON.stringify(riskId) : '',
                        departmentId: departmentName ? JSON.stringify(departmentName) : '',
                        brandId: brandId ? JSON.stringify(brandId) : '',
                        year: year ? JSON.stringify(year) : '',
                        monthId: monthId ? JSON.stringify(monthId) : '',
                        enableYearStart: enableYearStart,
                        enableYearEnd: enableYearEnd,
                        priceStart: priceStart,
                        priceEnd: priceEnd,
                        ageLimitStart: ageLimitStart,
                        ageLimitEnd: ageLimitEnd,
                        maintainSize: maintainSize
                    },
                    dataType: "json",
                    success: function (data) {
                        if (data.ret == 1) {
                            data.data = data.data || {list: []};
                            if (data.data.list.length) {
                                var sb = new StringBuffer();
                                $("#detail-table-" + detailId).html('<tbody id="table_data"></tbody>');
                                sb.append("<thead><tr><th class='text-center'>#</th>");
                                //表头
                                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbmc"/></th>");

                                //表格内容
                                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbxh"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.ssks"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.snbh"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.zcbh"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintainer.assets.rgfy(wy)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintainer.assets.bjfy(wy)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.assets.zwxfy(wy)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.assets.wxcs"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.assets.blsj(c)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.assets.pjxysj(fz)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.assets.pjwxsj(fz)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.assets.whl(%)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.assets.byl(%)"/></th>"
                                    + "<th class='text-right'><fmt:message key="share.assets.nxzs"/><p class='sort'></p></th>"
                                    + "</tr></thead>");
                                $("#detail-table-" + detailId).prepend(sb.toString());
                                for (var i = 0; i < data.data.list.length; i++) {
                                    $("#detail-table-" + detailId + " tbody").append("<tr>"
                                        + "<td class='text-center'>" + (i + 1) + "</td>"
                                        + "<td class='spanTitle' onclick=query(\"device\",\"" + data.data.list[i].id + "\") title='" + (data.data.list[i].name || '') + "'>" + (data.data.list[i].name || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].modalName || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].department || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].manufacturer || '') + "</td>"
                                        + "<td class='text-right'>" + parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + parseFloat((data.data.list[i].curEstimatePartCost / CONST) || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].curToRepairCounts || 0) + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].curFaultCounts || 0) + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].curResponseMin || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].curRepairUsedMin || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].curIntactRatio || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                        + "</tr>");
                                }

                            } else {
                                $("#detail-table-" + detailId).html('<p><fmt:message key="share.talbe.myxgjl"/></p>');
                            }
                        } else {
                            flavrShowByTime(data.msg, null, "danger", false);
                        }
                    },
                    failure: function () {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                })
            } else {
                $(".detail-tr-" + detailId).addClass("hide");
                $("#detail-" + detailId).addClass("fa-plus");
                $("#detail-" + detailId).removeClass("fa-minus");
            }
        }

        function queryDeviceTable(param) {
            var param = param || {};
            publicAjax('<%=basePath%>/charts/hospital/department-maintain/device', 'post', $.extend({}, {
                hospitalId: hspId,
                riskId: riskId ? JSON.stringify(riskId) : '',
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                maintainerId: maintainerId || '',
                year: year ? JSON.stringify(year) : '',
                monthId: monthId ? JSON.stringify(monthId) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd,
                maintainSize: maintainSize
            }, param), function (data) {
                if (data.ret == 1) {
                    data.data = data.data || {list: []};
                    if (data.data.list.length) {
                        if (!$('#deviceModal').length) {
                            $('body').append('<div id="deviceModal" class="modal" style="padding-top: 58px;height: 100%;box-sizing: border-box;display: none;">' +
                                '<div class="box-body no-padding">' +
                                '   <table id="deviceTable" class="table table-bordered table-striped table-hover table-responsive">' +
                                '       <thead></thead>' +
                                '       <tbody id="device_data"></tbody>' +
                                '   </table>' +
                                '</div></div>');
                            $("#deviceModal").iziModal({
                                title: '<fmt:message key="maintain.overview.wxjl"/>',
                                headerColor: '#222431',
                                width: '100%',
                                radius: 3,
                                zindex: 1090,
                                navigateCaption: true,
                                navigateArrows: true, // closeToModal, closeScreenEdge
                                history: false,
                                restoreDefaultContent: false,
                                autoOpen: false, // Boolean, Number
                                bodyOverflow: true,
                                fullscreen: true,
                                overlayColor: 'rgba(0, 0, 0, 0)',
                                transitionIn: 'comingIn',
                                transitionOut: 'comingOut',
                                transitionInOverlay: 'fadeIn',
                                transitionOutOverlay: 'fadeOut',
                                onOpening: function () {
                                    $('#deviceModal').find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#assetModal\')" title="<fmt:message key="share.sift.dc"/>"><i class="fa fa-upload"></i></a>');
                                    $('#deviceModal .box-body').height($('#deviceModal').height() - 44);
                                },
                                onClosed: function () {
                                    clearTable($('#deviceModal'));
                                }
                            });
                        }
                        $('#deviceModal').find('thead').html('<th class="text-center">#</th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbmc"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbxh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.title.sblx"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.ssks"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.snbh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.zcbh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbcj"/></th>' +
                            '<th class="text-right"><fmt:message key="maintainer.assets.rgfy(wy)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintainer.assets.bjfy(wy)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.zwxfy(wy)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.wxcs"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.blsj(c)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.pjxysj(fz)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.pjwxsj(fz)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.whl(%)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.byl(%)"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.nxzs"/></th>');
                        var str = '';
                        for (var i = 0; i < data.data.list.length; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick=query(\"device\",\"" + data.data.list[i].id + "\") title='" + (data.data.list[i].name || '') + "'>" + (data.data.list[i].name || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].modalName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].firstTypeName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].department || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                + "<td class='no-cal text-right'>" + (data.data.list[i].manufacturer || '') + "</td>"
                                + "<td class='total-1 text-right'>" + parseFloat((data.data.list[i].curEstimateLabourCost / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='total-2 text-right'>" + parseFloat((data.data.list[i].curEstimatePartCost / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='total-3 text-right'>" + parseFloat((data.data.list[i].curEstimateTotalCost / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='total-4 text-right'>" + (data.data.list[i].curToRepairCounts || 0) + "</td>"
                                + "<td class='avg-1 text-right'>" + (data.data.list[i].curFaultCounts || 0) + "</td>"
                                + "<td class='total-5 text-right'>" + parseFloat(data.data.list[i].curResponseMin || 0).toFixed(2) + "</td>"
                                + "<td class='total-6 text-right'>" + parseFloat(data.data.list[i].curRepairUsedMin || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data.data.list[i].curIntactRatio || 0).toFixed(2) + "</td>"
                                + "<td class='avg-3 text-right'>" + parseFloat(data.data.list[i].curUpkeepRate || 0).toFixed(2) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                + "</tr>";
                        }

                        $('#device_data').html(str).siblings('tfoot').empty();
                        calTableData('deviceTable', true);
                        $("#deviceModal").iziModal('open');

                    }
                } else {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            });
        }

        function queryHaltTable(param) {
            param = param || {};
            publicAjax('<%=basePath%>/charts/hospital/department-maintain/halt', 'post', $.extend({}, {
                hospitalId: hspId,
                riskId: riskId ? JSON.stringify(riskId) : '',
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                maintainerId: maintainerId || '',
                year: year ? JSON.stringify(year) : '',
                monthId: monthId ? JSON.stringify(monthId) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd,
                maintainSize: maintainSize
            }, param), function (data) {
                if (data.ret == 1) {
                    data.data = data.data || {list: []};
                    if (data.data.list.length) {
                        if (!$('#deviceModal').length) {
                            $('body').append('<div id="deviceModal" class="modal" style="padding-top: 58px;height: 100%;box-sizing: border-box;display: none;">' +
                                '<div class="box-body no-padding">' +
                                '   <table id="deviceTable" class="table table-bordered table-striped table-hover table-responsive">' +
                                '       <thead></thead>' +
                                '       <tbody id="device_data"></tbody>' +
                                '   </table>' +
                                '</div></div>');
                            $("#deviceModal").iziModal({
                                title: '<fmt:message key="share.talbe.sbxq"/>',
                                headerColor: '#222431',
                                width: '100%',
                                radius: 3,
                                zindex: 1090,
                                navigateCaption: true,
                                navigateArrows: true, // closeToModal, closeScreenEdge
                                history: false,
                                restoreDefaultContent: false,
                                autoOpen: false, // Boolean, Number
                                bodyOverflow: true,
                                fullscreen: true,
                                overlayColor: 'rgba(0, 0, 0, 0)',
                                transitionIn: 'comingIn',
                                transitionOut: 'comingOut',
                                transitionInOverlay: 'fadeIn',
                                transitionOutOverlay: 'fadeOut',
                                onOpening: function () {
                                    $('#deviceModal').find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#assetModal\')" title="<fmt:message key="share.sift.dc"/>"><i class="fa fa-upload"></i></a>');
                                    $('#deviceModal .box-body').height($('#deviceModal').height() - 44);
                                },
                                onClosed: function () {
                                    clearTable($('#deviceModal'));
                                }
                            });
                        }
                        $('#deviceTable').find('thead').html('<th class="text-center">#</th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbmc"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbxh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.title.sblx"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.ssks"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.snbh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.zcbh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbcj"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.sbje(wy)"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.zjje(wy)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.assets.zwxfy(wy)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintainer.assets.pjdjsj(fz)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.wxsj(fz)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.xysj(fz)"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.wxs"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.gzms"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.gzms"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.wxdx"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.wxfs"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.smcs"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.wxrq"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.bxqnw"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.bjghcs"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.gcs"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.sbqyrq"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.ysysj(n)"/></th>' +
                            '<th class="text-right"><fmt:message key="share.sift.nxzs"/></th>' +
                            '<th class="text-left"><fmt:message key="maintian.record.ewm"/></th>');
                        var str = '';
                        for (var i = 0; i < data.data.list.length; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick=query(\"device\",\"" + data.data.list[i].id + "\") title='" + (data.data.list[i].name || '') + "'>" + (data.data.list[i].name || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].modalName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].firstTypeName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].department || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].manufacturer || '') + "</td>"
                                + "<td class='total-1 text-right'>" + parseFloat((data.data.list[i].price / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='total-2 text-right'>" + parseFloat((data.data.list[i].depreciationPrice / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='total-3 text-right'>" + parseFloat((data.data.list[i].estimateTotalCost / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='total-4 text-right'>" + (data.data.list[i].haltTime || 0) + "</td>"
                                + "<td class='total-5 text-right'>" + (data.data.list[i].repairUsedMin || 0) + "</td>"
                                + "<td class='total-6 text-right'>" + (data.data.list[i].responseMin || 0) + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].maintainer || '') + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].fault || '') + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].repairContent || '') + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].repairSize || '') + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].repairType || '') + "</td>"
                                + "<td class='total-7 text-right'>" + (data.data.list[i].visitCounts || 0) + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].repairTime || '') + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].repairCondition || '') + "</td>"
                                + "<td class='total-8 text-right'>" + (data.data.list[i].partCounts || 0) + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].engineer || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].enableDate || '') + "</td>"
                                + "<td class='total-9 text-right'>" + parseFloat(data.data.list[i].usedTime || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                + "<td class='no-cal'>" + (data.data.list[i].qrcode || '') + "</td>"
                                + "</tr>";
                        }

                        $('#device_data').html(str).siblings('tfoot').empty();
                        calTableData('deviceTable', true);
                        $("#deviceModal").iziModal('open');

                    }
                } else {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            });
        }

        // 通过设备型号查找设备(设备类型)
        function queryRecordData(detailId) {
            if ($(".detail-tr-" + detailId).hasClass("hide")) {
                $(".detail-tr-" + detailId).removeClass("hide");
                $("#detail-" + detailId).removeClass("fa-plus");
                $("#detail-" + detailId).addClass("fa-minus");
                $.ajax({
                    type: "POST",
                    url: '<%=basePath%>/charts/hospital/department-maintain/record',
                    data: $.extend({}, {
                      hospitalId: hspId,
                        riskId: riskId ? JSON.stringify(riskId) : '',
                        departmentId: departmentName ? JSON.stringify(departmentName) : '',
                        typeId: typeId ? JSON.stringify(typeId) : '',
                        brandId: brandId ? JSON.stringify(brandId) : '',
                        maintainerId: maintainerId || '',
                        year: year ? JSON.stringify(year) : '',
                        monthId: monthId ? JSON.stringify(monthId) : '',
                        enableYearStart: enableYearStart,
                        enableYearEnd: enableYearEnd,
                        priceStart: priceStart,
                        priceEnd: priceEnd,
                        ageLimitStart: ageLimitStart,
                        ageLimitEnd: ageLimitEnd,
                        maintainSize: maintainSize
                    }, detailId),
                    dataType: "json",
                    success: function (data) {
                        if (data.ret == 1) {
                            data.data = data.data || {list: []};
                            if (data.data.list.length) {
                                var sb = new StringBuffer();
                                $("#detail-table-" + detailId).html('<tbody id="table_data"></tbody>');
                                sb.append("<thead><tr><th class='text-center'>#</th>");
                                //表头
                                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbmc"/></th>");

                                //表格内容
                                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbxh"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.snbh"/></th>"
                                    + "<th class=''><fmt:message key="share.assets.zcbh"/></th>"
                                    + "<th class=''><fmt:message key="share.assets.ssks"/></th>"
                                    + "<th class='text-right'><fmt:message key="share.assets.nxzs"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.ewm"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.bxsj"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.record.xysj(fz)"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.record.wxsj(fz)"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.wxfs"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.wxs"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.gcs"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.record.smcs"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.wxdx"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.record.gswxfy"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.gzms"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.wxzdms"/></th>"
                                    + "<th class='text-right'><fmt:message key="maintian.record.bjghcs"/></th>"
                                    + "<th class=''><fmt:message key="maintian.record.bxqnw"/></th>"
                                    + "</tr></thead>");
                                $("#detail-table-" + detailId).prepend(sb.toString());
                                for (var i = 0; i < data.data.list.length; i++) {
                                    $("#detail-table-" + detailId + " tbody").append("<tr>"
                                        + "<td class='text-center'>" + (i + 1) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].name || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].modalName || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].department || '') + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].qrcode || '') + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].repairTime || 0) + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].responseMin || 0) + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].repairUsedMin || 0) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].repairType || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].maintainer || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].engineer || '') + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].visitCounts || 0) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].repairSize || '') + "</td>"
                                        + "<td class='text-right'>" + parseFloat((data.data.list[i].estimateTotalCost / 100) || 0).toFixed(2) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].fault || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].repairContent || '') + "</td>"
                                        + "<td class='text-right'>" + (data.data.list[i].partCounts || 0) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].repairCondition || '') + "</td>"
                                        + "</tr>");
                                }

                            } else {
                                $("#detail-table-" + detailId).html('<p><fmt:message key="share.talbe.myxgjl"/></p>');
                            }
                        } else {
                            flavrShowByTime(data.msg, null, "danger", false);
                        }
                    },
                    failure: function () {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                })
            } else {
                $(".detail-tr-" + detailId).addClass("hide");
                $("#detail-" + detailId).addClass("fa-plus");
                $("#detail-" + detailId).removeClass("fa-minus");
            }
        }

        function queryRecordTable(param) {
            var param = param || {};
            publicAjax('<%=basePath%>/charts/hospital/department-maintain/record', 'post', $.extend({}, {
                hospitalId: hspId,
                riskId: riskId ? JSON.stringify(riskId) : '',
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                maintainerId: maintainerId || '',
                year: year ? JSON.stringify(year) : '',
                monthId: monthId ? JSON.stringify(monthId) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd,
                maintainSize: maintainSize
            }, param), function (data) {
                if (data.ret == 1) {
                    data.data = data.data || {list: []};
                    if (data.data.list.length) {
                        if (!$('#assetModal').length) {
                            $('body').append('<div id="assetModal" class="modal" style="padding-top: 58px;height: 100%;box-sizing: border-box;display: none;">' +
                                '<div class="box-body no-padding">' +
                                '   <table id="assetTable" class="table table-bordered table-striped table-hover table-responsive">' +
                                '       <thead></thead>' +
                                '       <tbody id="asset_data"></tbody>' +
                                '   </table>' +
                                '</div></div>');
                            $("#assetModal").iziModal({
                                title: param.maintainSize == 1 ? '<fmt:message key="maintain.overview.dwxjl"/>' : param.maintainSize == 2 ? '<fmt:message key="maintain.overview.zwxjl"/>' : param.maintainSize == 3 ? '<fmt:message key="maintain.overview.xwxjl"/>' : '<fmt:message key="maintain.overview.wxjl"/>',
                                headerColor: '#222431',
                                width: '100%',
                                radius: 3,
                                zindex: 1090,
                                navigateCaption: true,
                                navigateArrows: true, // closeToModal, closeScreenEdge
                                history: false,
                                restoreDefaultContent: false,
                                autoOpen: false, // Boolean, Number
                                bodyOverflow: true,
                                fullscreen: true,
                                overlayColor: 'rgba(0, 0, 0, 0)',
                                transitionIn: 'comingIn',
                                transitionOut: 'comingOut',
                                transitionInOverlay: 'fadeIn',
                                transitionOutOverlay: 'fadeOut',
                                onOpening: function () {
                                    $('#assetModal').find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#assetModal\')" title="<fmt:message key="share.sift.dc"/>"><i class="fa fa-upload"></i></a>');
                                    $('#assetModal .box-body').height($('#assetModal').height() - 44);
                                },
                                onClosed: function () {
                                    clearTable($('#assetModal'));
                                }
                            });
                        } else {
                            $('#assetModal').iziModal('setTitle', param.maintainSize == 1 ? '<fmt:message key="maintain.overview.dwxjl"/>' : param.maintainSize == 2 ? '<fmt:message key="maintain.overview.zwxjl"/>' : param.maintainSize == 3 ? '<fmt:message key="maintain.overview.xwxjl"/>' : '<fmt:message key="maintain.overview.wxjl"/>');
                        }
                        $('#assetModal').find('thead').html('<th class="text-center">#</th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbmc"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbxh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.title.sblx"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.snbh"/></th>' +
                            '<th class=""><fmt:message key="share.assets.zcbh"/></th>' +
                            '<th class=""><fmt:message key="share.assets.ssks"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.nxzs"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.ewm"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.bxsj"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.xysj(fz)"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.wxsj(fz)"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.wxfs"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.wxs"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.gcs"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.smcs"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.wxdx"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.gswxfy"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.gzms"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.wxzdms"/></th>' +
                            '<th class="text-right"><fmt:message key="maintian.record.bjghcs"/></th>' +
                            '<th class=""><fmt:message key="maintian.record.bxqnw"/></th>');
                        var str = '';
                        for (var i = 0; i < data.data.list.length; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal text-left spanTitle' onclick=query(\"device\",\"" + data.data.list[i].id + "\") title='" + (data.data.list[i].name || '') + "'>" + (data.data.list[i].name || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].modalName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].firstTypeName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].department || '') + "</td>"
                                + "<td class='avg-1 text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].qrcode || '') + "</td>"
                                + "<td class='no-cal text-right'>" + (data.data.list[i].repairTime || '') + "</td>"
                                + "<td class='total-2 text-right'>" + (data.data.list[i].responseMin || 0) + "</td>"
                                + "<td class='total-3 text-right'>" + (data.data.list[i].repairUsedMin || 0) + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].repairType || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].maintainer || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].engineer || '') + "</td>"
                                + "<td class='total-4 text-right'>" + (data.data.list[i].visitCounts || 0) + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].repairSize || '') + "</td>"
                                + "<td class='total-5 text-right'>" + parseFloat((data.data.list[i].estimateTotalCost / 100) || 0).toFixed(2) + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].fault || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].repairContent || '') + "</td>"
                                + "<td class='total-6 text-right'>" + (data.data.list[i].partCounts || 0) + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].repairCondition || '') + "</td>"
                                + "</tr>";
                        }

                        $('#asset_data').html(str).siblings('tfoot').empty();
                        calTableData('assetTable', true);
                        $("#assetModal").iziModal('open');

                    }
                } else {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            });
        }

        $('#morebrand').click(morebrands);

        function morebrands() {
            loading(function () {
                var modal = $('#modal').attr('modal', 'brand');
                var sb = new StringBuffer();
                var tag = $('#tag').val();
                var data = brandJson;
                var table = $("#tblSort").html('<tbody></tbody>');
                var tbody = table.find('tbody');
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>");

                //表格内容
                sb.append("<th class='text-right'><fmt:message key="maintainer.table.wxcs(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxcstb(%)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.dwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.zwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.xwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxsbsl(t)"/></th>"
                    + (function () {
                        var str = '';
                        if (tag == '0') {
                            str += "<th class='text-right'><fmt:message key="share.assets.sbje(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.rgfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.bjfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.zwxfy(wy)"/></th>";
                        } else if (tag == '1') {
                            str += "<th class='text-right'><fmt:message key="charts.axis.wywxje"/></th>";
                            str += "<th class='text-right'><fmt:message key="share.sift.nxzs"/></th>";
                        } else if (tag == '2') {
                            str += "<th class='text-right'><fmt:message key="maintian.assets.whl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.byl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintain.table.xjl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.ycxfl(%)"/></th>";
                        } else if (tag == '3') {
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.djcs(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjdjsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.blsj(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.zgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.record.bjghcs"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.pjwxsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjxysj(fz)"/></th>";
                        }
                        return str;
                    })());
                table.prepend(sb.toString());
                groupLoading(data.length, function (min, max) {
                    var str = '';
                    for (var i = min; i < max; i++) {
                        str += "<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal spanTitle' onclick='query(\"brand\",\"" + data[i].id + "\")'>" + (data[i].name || '') + "</td>"
                            + "<td class='total-1 text-right" + (data[i].curToRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{brandId:[" + data[i].id + "]}'," + data[i].curToRepairCounts + ")\">" + (data[i].curToRepairCounts || 0) + "</td>"
                            + "<td class='avg-2 text-right'>" + parseFloat(data[i].toRepairCountsYoy || 0).toFixed(2) + "</td>"
                            + "<td class='total-3 text-right" + (data[i].curBigRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:1,brandId:[" + data[i].id + "]}'," + data[i].curBigRepairCounts + ")\">" + (data[i].curBigRepairCounts || 0) + "</td>"
                            + "<td class='total-4 text-right" + (data[i].curMiddleRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:2,brandId:[" + data[i].id + "]}'," + data[i].curMiddleRepairCounts + ")\">" + (data[i].curMiddleRepairCounts || 0) + "</td>"
                            + "<td class='total-5 text-right" + (data[i].curSmallRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:3,brandId:[" + data[i].id + "]}'," + data[i].curSmallRepairCounts + ")\">" + (data[i].curSmallRepairCounts || 0) + "</td>"
                            + "<td class='total-6 text-right" + (data[i].curRepairedDeviceCounts ? ' spanTitle' : '') + "' onclick=\"query('repair','{brandId:[" + data[i].id + "]}'," + data[i].curRepairedDeviceCounts + ")\">" + (data[i].curRepairedDeviceCounts || 0) + "</td>"
                            + (function () {
                                var str = '';
                                if (tag == '0') {
                                    str += "<td class='total-7 text-right'>" + parseFloat(data[i].curDevicePrice / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-8 text-right'>" + parseFloat(data[i].curEstimateLabourCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-9 text-right'>" + parseFloat(data[i].curEstimatePartCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-0 text-right'>" + parseFloat(data[i].curEstimateTotalCost / CONST || 0).toFixed(2) + "</td>";
                                } else if (tag == '1') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curEstimateCostWanyuan || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curAgeLimitMeasure || 0).toFixed(2) + "</td>";
                                } else if (tag == '2') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curIntactRatio || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curUpkeepRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-9 text-right'>" + parseFloat(data[i].curInspectionRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + parseFloat(data[i].lastOnceRepairRate || 0).toFixed(2) + "</td>";
                                } else if (tag == '3') {
                                    str += "<td class='total-7 text-right" + (data[i].curHaltCounts ? ' spanTitle' : '') + "' onclick=\"query('halt','{brandId:[" + data[i].id + "]}'," + data[i].curHaltCounts + ")\">" + (data[i].curHaltCounts || 0) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + (data[i].curAvgHaltMin || 0) + "</td>";
                                    str += "<td class='total-9 text-right'>" + (data[i].curFaultCounts || 0) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + (data[i].curAvgFaultMin || 0) + "</td>";
                                    str += "<td class='total-11 text-right'>" + (data[i].curTotalFaultMin || 0) + "</td>";
                                    str += "<td class='total-22 text-right'>" + (data[i].curPartChangeCounts || 0) + "</td>";
                                    str += "<td class='avg-33 text-right'>" + (data[i].curAvgRepairUsedMin || 0) + "</td>";
                                    str += "<td class='avg-44 text-right'>" + (data[i].curAvgResponseMin || 0) + "</td>";
                                }
                                return str;
                            })()
                            + "</tr>";
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData('tblSort', true);
                });
                modal.iziModal('setTitle', '<fmt:message key="share.table.title.sbxhfbxq"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }


        $('#moremaintainer').click(moremaintainers);

        function moremaintainers() {
            loading(function () {
                var modal = $('#modal').attr('modal', 'maintainer');
                var sb = new StringBuffer();
                var tag = $('#tag').val();
                var data = maintainerJson;
                var table = $("#tblSort").html('<tbody></tbody>');
                var tbody = table.find('tbody');
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.wxs"/></th>");

                //表格内容
                sb.append("<th class='text-right'><fmt:message key="maintainer.table.wxcs(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxcstb(%)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.dwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.zwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.table.xwxsl(c)"/></th>"
                    + "<th class='text-right'><fmt:message key="maintain.charts.wxsbsl(t)"/></th>"
                    + (function () {
                        var str = '';
                        if (tag == '0') {
                            str += "<th class='text-right'><fmt:message key="share.assets.sbje(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.rgfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.bjfy(wy)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.zwxfy(wy)"/></th>";
                        } else if (tag == '1') {
                            str += "<th class='text-right'><fmt:message key="charts.axis.wywxje"/></th>";
                            str += "<th class='text-right'><fmt:message key="share.sift.nxzs"/></th>";
                        } else if (tag == '2') {
                            str += "<th class='text-right'><fmt:message key="maintian.assets.whl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.assets.byl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintain.table.xjl(%)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.ycxfl(%)"/></th>";
                        } else if (tag == '3') {
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.djcs(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjdjsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.blsj(c)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.zgzsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintian.record.bjghcs"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.table.pjwxsj(fz)"/></th>";
                            str += "<th class='text-right'><fmt:message key="maintainer.assets.pjxysj(fz)"/></th>";
                        }
                        return str;
                    })());
                table.prepend(sb.toString());
                groupLoading(data.length, function (min, max) {
                    var str = '';
                    for (var i = min; i < max; i++) {
                        str += "<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal spanTitle' onclick='query(\"maintainer\",\"" + data[i].id + "\")'>" + (data[i].name || '') + "</td>"
                            + "<td class='total-1 text-right" + (data[i].curToRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainerId:" + data[i].id + "}'," + data[i].curToRepairCounts + ")\">" + (data[i].curToRepairCounts || 0) + "</td>"
                            + "<td class='avg-2 text-right'>" + parseFloat(data[i].toRepairCountsYoy || 0).toFixed(2) + "</td>"
                            + "<td class='total-3 text-right" + (data[i].curBigRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:1,maintainerId:" + data[i].id + "}'," + data[i].curBigRepairCounts + ")\">" + (data[i].curBigRepairCounts || 0) + "</td>"
                            + "<td class='total-4 text-right" + (data[i].curMiddleRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:2,maintainerId:" + data[i].id + "}'," + data[i].curMiddleRepairCounts + ")\">" + (data[i].curMiddleRepairCounts || 0) + "</td>"
                            + "<td class='total-5 text-right" + (data[i].curSmallRepairCounts ? ' spanTitle' : '') + "' onclick=\"query('record','{maintainSize:3,maintainerId:" + data[i].id + "}'," + data[i].curSmallRepairCounts + ")\">" + (data[i].curSmallRepairCounts || 0) + "</td>"
                            + "<td class='total-6 text-right" + (data[i].curRepairedDeviceCounts ? ' spanTitle' : '') + "' onclick=\"query('repair','{maintainerId:" + data[i].id + "}'," + data[i].curRepairedDeviceCounts + ")\">" + (data[i].curRepairedDeviceCounts || 0) + "</td>"
                            + (function () {
                                var str = '';
                                if (tag == '0') {
                                    str += "<td class='total-7 text-right'>" + parseFloat(data[i].curDevicePrice / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-8 text-right'>" + parseFloat(data[i].curEstimateLabourCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-9 text-right'>" + parseFloat(data[i].curEstimatePartCost / CONST || 0).toFixed(2) + "</td>";
                                    str += "<td class='total-0 text-right'>" + parseFloat(data[i].curEstimateTotalCost / CONST || 0).toFixed(2) + "</td>";
                                } else if (tag == '1') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curEstimateCostWanyuan || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curAgeLimitMeasure || 0).toFixed(2) + "</td>";
                                } else if (tag == '2') {
                                    str += "<td class='avg-7 text-right'>" + parseFloat(data[i].curIntactRatio || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + parseFloat(data[i].curUpkeepRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-9 text-right'>" + parseFloat(data[i].curInspectionRate || 0).toFixed(2) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + parseFloat(data[i].lastOnceRepairRate || 0).toFixed(2) + "</td>";
                                } else if (tag == '3') {
                                    str += "<td class='total-7 text-right" + (data[i].curHaltCounts ? ' spanTitle' : '') + "' onclick=\"query('halt','{maintainerId:[" + data[i].id + "]}'," + data[i].curHaltCounts + ")\">" + (data[i].curHaltCounts || 0) + "</td>";
                                    str += "<td class='avg-8 text-right'>" + (data[i].curAvgHaltMin || 0) + "</td>";
                                    str += "<td class='total-9 text-right'>" + (data[i].curFaultCounts || 0) + "</td>";
                                    str += "<td class='avg-0 text-right'>" + (data[i].curAvgFaultMin || 0) + "</td>";
                                    str += "<td class='total-11 text-right'>" + (data[i].curTotalFaultMin || 0) + "</td>";
                                    str += "<td class='total-22 text-right'>" + (data[i].curPartChangeCounts || 0) + "</td>";
                                    str += "<td class='avg-33 text-right'>" + (data[i].curAvgRepairUsedMin || 0) + "</td>";
                                    str += "<td class='avg-44 text-right'>" + (data[i].curAvgResponseMin || 0) + "</td>";
                                }
                                return str;
                            })()
                            + "</tr>";
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData('tblSort', true);
                });
                modal.iziModal('setTitle', '<fmt:message key="share.table.title.wxsfbxq"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }

        $('#moredevices').click(moredevices);

        function moredevices() {
            loading(function () {
                var modal = $('#modal').attr('modal', 'device');
                var sb = new StringBuffer();
                var table = $("#tblSort").html('<tbody></tbody>');
                var tbody = table.find('tbody');
                var data = deviceJson;
                sb.append("<thead><tr><th class='text-center' key='' value='<fmt:message key="share.table.tail.zj"/>'>#</th>");
                //表头
                sb.append("<th class='text-left' key='name'><fmt:message key="share.table.head.sbmc"/></th>");

                //表格内容
                sb.append("<th class='text-left' key='modalName'><fmt:message key="share.table.head.sbxh"/></th>"
                    + "<th class='text-left' key='firstTypeName'><fmt:message key="share.title.sblx"/></th>"
                    + "<th class='text-left' key='departmentName'><fmt:message key="share.assets.ssks"/></th>"
                    + "<th class='text-left' key='manufacturer'><fmt:message key="share.table.head.sbcj"/></th>"
                    + "<th class='text-left' key='sn' value=''><fmt:message key="share.assets.snbh"/></th>"
                    + "<th class='text-left' key='assetsNo' value=''><fmt:message key="share.assets.zcbh"/></th>"
                    + "<th class='text-right' key='curEstimateLabourCost' value='" + fix2(data[-1].curEstimateLabourCost / CONST) + "'><fmt:message key="maintainer.assets.rgfy(wy)"/></th>"
                    + "<th class='text-right' key='curEstimatePartCost' value='" + fix2(data[-1].curEstimatePartCost / CONST) + "'><fmt:message key="maintainer.assets.bjfy(wy)"/></th>"
                    + "<th class='text-right' key='curEstimateTotalCost' value='" + fix2(data[-1].curEstimateTotalCost / CONST) + "'><fmt:message key="maintian.assets.zwxfy(wy)"/></th>"
                    + "<th class='text-right' key='curToRepairCounts' value='" + fix0(data[-1].curToRepairCounts) + "'><fmt:message key="maintian.assets.wxcs"/></th>"
                    + "<th class='text-right' key='curFaultCounts' value='" + fix0(data[-1].curFaultCounts) + "'><fmt:message key="maintian.assets.blsj(c)"/></th>"
                    + "<th class='text-right' key='curResponseMin' value='" + fix2(data[-1].curResponseMin / data.length) + "'><fmt:message key="maintian.assets.pjxysj(fz)"/></th>"
                    + "<th class='text-right' key='curRepairUsedMin' value='" + fix2(data[-1].curRepairUsedMin / data.length) + "'><fmt:message key="maintian.assets.pjwxsj(fz)"/></th>"
                    + "<th class='text-right' key='curIntactRatio' value='" + fix2(data[-1].curIntactRatio / data.length) + "'><fmt:message key="maintian.assets.whl(%)"/></th>"
                    + "<th class='text-right' key='ageLimitMeasure' value='" + fix2(data[-1].ageLimitMeasure / data.length) + "'><fmt:message key="share.assets.nxzs"/><p class='sort'></p></th>"
                    + "</tr></thead>");
                table.prepend(sb.toString());
                groupLoading(data.length, function (min, max) {
                    var str = '';
                    for (var i = min; i < max; i++) {
                        str += "<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal spanTitle' onclick='query(\"device\",\"" + idsDevice[i] + "\")' title='" + xAxisDevice[i] + "'>" + xAxisDevice[i] + "</td>"
                            + "<td class='no-cal text-left'>" + modalNameDevice[i] + "</td>"
                            + "<td class='no-cal text-left'>" + fixStr(data[i].firstTypeName) + "</td>"
                            + "<td class='no-cal text-left'>" + departmentDevice[i] + "</td>"
                            + "<td class='no-cal' title='" + manufacturerDevice[i] + "'>" + manufacturerDevice[i] + "</td>"
                            + "<td class='no-cal text-left'>" + snDevice[i] + "</td>"
                            + "<td class='no-cal text-left'>" + assetsNoDevice[i] + "</td>"
                            + "<td class='total-1 text-right'>" + curEstimateLabourCostDevice[i] + "</td>"
                            + "<td class='total-2 text-right'>" + curEstimatePartCostDevice[i] + "</td>"
                            + "<td class='total-3 text-right'>" + curEstimateTotalCostDevice[i] + "</td>"
                            + "<td class='total-4 text-right'>" + curToRepairCountsDevice[i] + "</td>"
                            + "<td class='total-6 text-right'>" + curFaultCountsDevice[i] + "</td>"
                            + "<td class='total-7 text-right'>" + curResponseMinDevice[i] + "</td>"
                            + "<td class='total-8 text-right'>" + curRepairUsedMinDevice[i] + "</td>"
                            + "<td class='avg-1 text-right'>" + curIntactRatioDevice[i] + "</td>"
                            + "<td class='avg-3 text-right'>" + ageLimitMeasureDevice[i] + "</td>"
                            + "</tr>";
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData('tblSort', true);
                });
                modal.iziModal('setTitle', '<fmt:message key="share.table.title.sbfbxq"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }

        // 柱状 + 折线
        var optionB = {
            color: ['#2089ff', '#6c63ff', '#12a0df', '#fb8a22', '#fef534'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                },
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var index = a[0].dataIndex;
                        return xAxisType[index] + '<br/>'
                            + '<fmt:message key="maintain.charts.dwxsl"/>：' + curBigRepairCountsType[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.zwxsl"/>：' + curMiddleRepairCountsType[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.xwxsl"/>：' + curSmallRepairCountsType[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.blsj"/>：' + curFaultCountsType[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.xjl"/>：' + curInspectionRateType[index] + '%<br/>'
                            + '<fmt:message key="maintain.charts.byl"/>：' + curUpkeepRateType[index] + '%<br/>'
                            + '<fmt:message key="maintain.charts.whl"/>：' + curIntactRatioType[index] + '%<br/>'
                            + '<fmt:message key="maintain.charts.wxfy"/>：' + curEstimateTotalCostType[index] + '<fmt:message key="share.unit.wanyuan"/>';
                    }
                }
            },
            legend: {
                x: "right",
                left: 8 * rem,
                textStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                data: ['<fmt:message key="maintain.charts.dwxsl"/>', '<fmt:message key="maintain.charts.zwxsl"/>', '<fmt:message key="maintain.charts.xwxsl"/>', '<fmt:message key="maintain.charts.blsj"/>', '<fmt:message key="maintain.charts.xjl"/>', '<fmt:message key="maintain.charts.byl"/>']
            },
            grid: {
                top: 1.2 * rem,
                left: 0.4 * rem,
                right: 0.4 * rem,
                bottom: 0.8 * rem,
                containLabel: true
            },
            dataZoom: [{
                type: 'inside',
                xAxisIndex: [0],
                start: 0,
                end: 100
            }],
            xAxis: {
                type: 'category',
                data: [],
                axisLabel: {
                    rotate: 30,
                    fontSize: 0.28 * rem
                }
            },
            yAxis: [{
                name: '<fmt:message key="share.unit.ci"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    lineStyle: {
                        type: 'dashed'
                    }
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }, {
                name: '%',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    show: false
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }],
            series: [{
                name: '<fmt:message key="maintain.charts.dwxsl"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                stack: 'one',
                data: [],
                itemStyle: {
                    normal: {
                        opacity: 0.8
                    }
                }
            }, {
                name: '<fmt:message key="maintain.charts.zwxsl"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                stack: 'one',
                data: [],
                itemStyle: {
                    normal: {
                        opacity: 0.8
                    }
                }
            }, {
                name: '<fmt:message key="maintain.charts.xwxsl"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                stack: 'one',
                data: [],
                itemStyle: {
                    normal: {
                        opacity: 0.8
                    }
                }
            }, {
                name: '<fmt:message key="maintain.charts.blsj"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: [],
                itemStyle: {
                    normal: {
                        opacity: 0.8
                    }
                }
            }, {
                name: '<fmt:message key="maintain.charts.xjl"/>',
                type: 'line',
                yAxisIndex: 1,
                data: [],
                lineStyle: {
                    normal: {
                        width: 2
                    }
                }
            }, {
                name: '<fmt:message key="maintain.charts.byl"/>',
                type: 'line',
                yAxisIndex: 1,
                data: [],
                lineStyle: {
                    normal: {
                        width: 2
                    }
                }
            }]
        };

        // 柱状 + 折线
        var optionB1 = {
            color: ['#3b3b8a', '#3066a0', '#4799a7', '#abcb75', '#c9b360', '#194183', '#97aa15', '#3eb043', '#953e64', '#aeac73'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                },
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var index = a[0].dataIndex;
                        return xAxisB[index] + '<br/>'
                            + '<fmt:message key="maintain.charts.dwxsl"/>：' + curBigRepairCountsB[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.zwxsl"/>：' + curMiddleRepairCountsB[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.xwxsl"/>：' + curSmallRepairCountsB[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.wxcs"/>：' + curToRepairCountsB[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.blsj"/>：' + curFaultCountsB[index] + '<fmt:message key="share.unit.ci"/><br/>'
                            + '<fmt:message key="maintain.charts.rgfy"/>：' + curEstimateLabourCostB[index] + '<fmt:message key="share.unit.wanyuan"/><br/>'
                            + '<fmt:message key="maintain.charts.bjfy"/>：' + curEstimatePartCostB[index] + '<fmt:message key="share.unit.wanyuan"/><br/>'
                            + '<fmt:message key="maintain.charts.wxfy"/>：' + curEstimateTotalCostB[index] + '<fmt:message key="share.unit.wanyuan"/><br/>'
                            + '<fmt:message key="maintain.charts.xjl"/>：' + curInspectionRateB[index] + '%<br/>'
                            + '<fmt:message key="maintain.charts.byl"/>：' + curUpkeepRateB[index] + '%';
                    }
                }
            },
            legend: {
                x: "right",
                left: 7 * rem,
                textStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                data: ['<fmt:message key="maintain.charts.dwxsl"/>', '<fmt:message key="maintain.charts.zwxsl"/>', '<fmt:message key="maintain.charts.xwxsl"/>', '<fmt:message key="maintain.charts.wxcs"/>', '<fmt:message key="maintain.charts.blsj"/>', '<fmt:message key="maintain.charts.rgfy"/>', '<fmt:message key="maintain.charts.bjfy"/>', '<fmt:message key="maintain.charts.wxfy"/>', '<fmt:message key="maintain.charts.xjl"/>', '<fmt:message key="maintain.charts.byl"/>', '<fmt:message key="maintain.charts.wxcstb"/>'],
                selected: {
                    '<fmt:message key="maintain.charts.wxcs"/>': false,
                    '<fmt:message key="maintain.charts.blsj"/>': false,
                    '<fmt:message key="maintain.charts.rgfy"/>': false,
                    '<fmt:message key="maintain.charts.bjfy"/>': false,
                    '<fmt:message key="maintain.charts.wxcstb"/>': false
                }
            },
            grid: {
                top: 1.2 * rem,
                left: 0.4 * rem,
                right: 0.4 * rem,
                bottom: 0.8 * rem,
                containLabel: true
            },
            xAxis: {
                type: 'category',
                data: [],
                axisLabel: {
                    rotate: 30,
                    fontSize: 0.28 * rem
                }
            },
            yAxis: [{
                name: '<fmt:message key="share.unit.ci"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    lineStyle: {
                        type: 'dashed'
                    }
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }, {
                name: '<fmt:message key="share.unit.wanyuan"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    show: false
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }, {
                name: '%',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA'
                },
                splitLine: {
                    show: false
                },
                offset: 0.8 * rem,
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }],
            series: [{
                name: '<fmt:message key="maintain.charts.dwxsl"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                stack: 'one',
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.zwxsl"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                stack: 'one',
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.xwxsl"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                stack: 'one',
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.wxcs"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.blsj"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.rgfy"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                yAxisIndex: 1,
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.bjfy"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                yAxisIndex: 1,
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.wxfy"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                yAxisIndex: 1,
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.xjl"/>',
                type: 'line',
                yAxisIndex: 2,
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.byl"/>',
                type: 'line',
                yAxisIndex: 2,
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.wxcstb"/>',
                type: 'line',
                yAxisIndex: 2,
                data: []
            }]
        };

        var optionB2 = {
            color: ['#2089ff', '#6c63ff', '#12a0df', '#fb8a22', '#fef534'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                },
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var index = a[0].dataIndex;
                        return xAxisType[index] + '<br/>'
                            + '<fmt:message key="maintain.charts.pjxysj"/>：' + curAvgResponseMinType[index] + '<fmt:message key="share.unit.fenzhong"/><br/>'
                            + '<fmt:message key="maintainer.assets.pjgzsj"/>：' + typeJson[index].curAvgFaultMin + '<fmt:message key="share.unit.fenzhong"/><br/>'
                            + '<fmt:message key="maintainer.assets.pjdjsj"/>：' + typeJson[index].curAvgHaltMin + '<fmt:message key="share.unit.fenzhong"/><br/>'
                            + '<fmt:message key="maintain.charts.pjwxsj"/>：' + curAvgRepairUsedMinType.calc('/', 3600, 2)[index] + '<fmt:message key="share.unit.fenzhong"/>';
                    }
                }
            },
            legend: {
                x: "right",
                textStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                data: ['<fmt:message key="maintain.charts.pjxysj"/>', '<fmt:message key="maintainer.assets.pjgzsj"/>', '<fmt:message key="maintainer.assets.pjdjsj"/>', '<fmt:message key="maintain.charts.pjwxsj"/>']
            },
            dataZoom: [{
                type: 'inside',
                xAxisIndex: [0],
                start: 0,
                end: 100
            }],
            grid: {
                top: 1.2 * rem,
                left: 0.4 * rem,
                right: 0.4 * rem,
                bottom: 0.8 * rem,
                containLabel: true
            },
            xAxis: {
                type: 'category',
                data: [],
                axisLabel: {
                    rotate: 30,
                    fontSize: 0.28 * rem
                }
            },
            yAxis: [{
                name: '<fmt:message key="share.unit.fenzhong"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }, {
                name: '<fmt:message key="share.unit.tian"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    show: false
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }],
            series: [{
                name: '<fmt:message key="maintain.charts.pjxysj"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: []
            }, {
                name: '<fmt:message key="maintainer.assets.pjgzsj"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: []
            }, {
                name: '<fmt:message key="maintainer.assets.pjdjsj"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: []
            }, {
                name: '<fmt:message key="maintain.charts.pjwxsj"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                yAxisIndex: 1,
                data: []
            }]
        };

        //设备年限气泡图
        var optionAgelimit = {
            color: ['#31860f'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'item',
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var index = a.dataIndex;
                        return xAxisType[index] + '<br/>'
                            + '<fmt:message key="share.overview.sbje"/>：' + curDevicePriceType[index] + '<fmt:message key="share.unit.wanyuan"/><br/>'
                            + '<fmt:message key="brand.overview.wxje"/>：' + curEstimateTotalCostType[index] + '<fmt:message key="share.unit.wanyuan"/><br/>'
                            + '<fmt:message key="charts.axis.wywxje"/>：' + curEstimateCostWanyuanType[index] + '<br/>'
                            + '<fmt:message key="share.assets.nxzs"/>：' + curAgeLimitMeasureType[index];
                    }
                }
            },
            dataZoom: [{
                type: 'inside',
                xAxisIndex: [0],
                start: 0,
                end: 100
            },
                {
                    type: 'inside',
                    yAxisIndex: [0],
                    start: 0,
                    end: 100
                }
            ],
            grid: {
                top: 1.2 * rem,
                left: 0.4 * rem,
                right: 2.4 * rem,
                bottom: 0.8 * rem,
                containLabel: true
            },
            xAxis: {
                name: '<fmt:message key="charts.axis.sbje-wy"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                axisLabel: {
                    show: true,
                    fontSize: 0.28 * rem,
                    textStyle: {
                        color: '#fff'
                    }
                },
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#f00',
                        type: 'dashed'
                    }
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            yAxis: [{
                name: '<fmt:message key="charts.axis.wxje-wy"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                axisLabel: {
                    show: true,
                    fontSize: 0.28 * rem,
                    textStyle: {
                        color: '#fff'
                    }
                },
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#f00',
                        type: 'dashed'
                    }
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            }],
            series: [{
                type: 'scatter',
                data: [],
                symbolSize: function (data) {
                    if (data[2] === 0) return 0;
                    return 35;
                },
                markLine: {
                    lineStyle: {
                        normal: {
                            color: '#f00',
                            type: 'dashed',
                            opacity: 0.4
                        }
                    },
                    data: [
                        {
                            type: 'average',
                            name: '<fmt:message key="charts.avg.sbjepjz(wy)"/>',
                            valueIndex: 0,
                            xAxis: null
                        },
                        {
                            type: 'average',
                            name: '<fmt:message key="charts.avg.wxjepjz(wy)"/>',
                            valueIndex: 1,
                            yAxis: null
                        }
                    ]
                }
            }]
        };
    </script>
    </body>
</fmt:bundle>
</html>
